We've a Mac Mini that does some automated testing from a brew Jenkins install, on a Mac Mini in our office, which we're using a test tool called "Genie", which at it's lower level, creates a java.awt.Robot
, but at sun.awt.HToolkit.createRobot
, a java.awt.HeadlessException
occurs.
java.awt.HeadlessException
at sun.awt.HToolkit.createRobot(HToolkit.java:160)
at java.awt.Robot.init(Robot.java:138)
at java.awt.Robot.<init>(Robot.java:96)
at com.adobe.genie.genieUIRobot.UIFunctions.<init>(Unknown Source)
at com.adobe.genie.executor.uiEvents.UIImage.<init>(Unknown Source)
Funny thing is that the exact same job works completely fine on my own MacBook Pro, from the exact same brew Jenkins install.
Really confused about it, and have tried some of the workaround answers that have popped on here, the launch script is:
java -Djava.awt.headless=false -jar /Developer/Genie/GenieScripts/Executor.jar --logFolder /tmp /Developer/Genie/GenieScripts/bin/scripts/TestScript.class
And then in the TestScript.java, there's
System.setProperty("java.awt.headless", "false");
System.setProperty("javafx.macosx.embedded", "true");
in a static {} block, in the constructor and in the start() function.
Both machines are fully up to date Mavericks OS machines.