I would like to work with this robot class :
http://docs.oracle.com/javase/1.5.0/docs/api/java/awt/Robot.html
for generating native system input´s, thats why i created this file:
import java.awt.Robot;
public class MouseClass {
public static void main(String[] args) throws Exception {
Robot robot = new Robot();
// SET THE MOUSE X Y POSITION
robot.mouseMove(300, 550);
}
}
but i got this error-msg:
Exception in thread "main" java.lang.NoClassDefFoundError: robot/robot_v1
Caused by: java.lang.ClassNotFoundException: robot.robot_v1
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
I thought, the awt.robot is already integrated in eclipse? ok if not..i dont know where to download this robot-class, the only page i found is:
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/awt/Robot.java
but thats "Robot.java" and the error-message doent change when i include this in my "src".
Any advices how i can use this robot-class?
SOLVED ,but:
i get a compilation problem
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at robot.robot_v1.main(robot_v1.java:5)
For this line:
public static void main(String[] args) throws Exception {
do i have to change name´s here as well in this case?
greetings
=> SOLDED with package robot;
MouseClassinrobot_v1.javafile, it can't find and load your class