<properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> In Gradle:
However, if you're looking for a specific JAR file that contains java.awt.Robot for some reason (like including it in a project that doesn't have access to the JDK's libraries), you would typically find it in the JDK's lib directory or within the JDK's rt.jar (or java.base for JDK 9 and later, which is not a traditional JAR file but a jmod).
import java.awt.AWTException; import java.awt.Robot; import java.awt.event.InputEvent;
For your reference, here are the steps to find or include it: If you're using a build tool like Maven or Gradle, you don't need to manually download JAR files for classes in java.awt.* . These tools manage dependencies for you.
For example, in Maven, you'd ensure you're using a Java version that includes java.awt.Robot by specifying the appropriate maven.compiler.source and maven.compiler.target versions: