Duplicate :
|
If DISPLAY is exported to Linux machine, the following instantiation won't be possible on Solaris: public class Robot { public static void main(String[] args) throws java.awt.AWTException { new java.awt.Robot(); } } On JDK7 it will lead to: Exception in thread "main" java.lang.IllegalArgumentException: button doesn't exist 12 at java.awt.event.InputEvent.getMaskForButton(InputEvent.java:233) at java.awt.Robot.<init>(Robot.java:101) at Robot.main(Robot.java:3) Probably, other OS combinations are possible. Verified for two linix machines. Code sample above works fine on JDK6