jemmyfx

How do I launch JemmyFXBrowser?


I acquired and built JemmyFX and JemmyFXBrowser from http://hg.openjdk.java.net/openjfx/8/master/tests/, but I cannot figure out how to launch it. From directory tests/tools/Jemmy, I first tried:

$ java -jar JemmyFXBrowser/dist/JemmyFXBrowser.jar

But this produces exception:

Exception in thread "main" java.lang.NoClassDefFoundError: org/jemmy/timing/State

Then I tried adding all the *.jars to the classpath like so:

$ java -cp ./JemmyFX/dist/JemmyFX.jar:./GlassRobot/dist/GlassRobot.jar:./GlassImage/dist/GlassImage.jar:./jemmy_core/JemmySupport.jar:./jemmy_core/JemmyAWTInput.jar:./jemmy_core/JemmyBrowser.jar:./jemmy_core/JemmyCore.jar:./jemmy_core/junit.jar -jar ./JemmyFXBrowser/dist/JemmyFXBrowser.jar

But this produces the very same exception mentioned above. So, I exploded the JemmyFXBrowser.jar to discover the name of the main class and tried this:

$ java -cp ./JemmyFX/dist/JemmyFX.jar:./GlassRobot/dist/GlassRobot.jar:./GlassImage/dist/GlassImage.jar:./jemmy_core/JemmySupport.jar:./jemmy_core/JemmyAWTInput.jar:./jemmy_core/JemmyBrowser.jar:./jemmy_core/JemmyCore.jar:./jemmy_core/junit.jar:./JemmyFXBrowser/dist/JemmyFXBrowser.jar org.jemmy.fx.Browser

This results in a couple of exceptions. First, this one:

Exception in thread "FX app launch thread" java.lang.ArrayIndexOutOfBoundsException: 0

And then this one, over and over again:

java.lang.IllegalStateException: Toolkit not initialized

Clearly, I am missing something very fundamental here, but I can find no documentation anywhere on how this app is supposed to be launched, and it has no built-in help.


Solution

  • The very next argument should be the main class of the application you want to test. We must also add our application *.jar (or *.jars) to the classpath.

    $ java -cp ./JemmyFX/dist/JemmyFX.jar:./GlassRobot/dist/GlassRobot.jar:./GlassImage/dist/GlassImage.jar:./jemmy_core/JemmySupport.jar:./jemmy_core/JemmyAWTInput.jar:./jemmy_core/JemmyBrowser.jar:./jemmy_core/JemmyCore.jar:./jemmy_core/junit.jar:./JemmyFXBrowser/dist/JemmyFXBrowser.jar:./MyApplication.jar org.jemmy.fx.Browser my.MainClass