JavaFx Ensemble on Raspberry pi

drenda picture drenda · Feb 2, 2015 · Viewed 9k times · Source

I'm trying to run Esemble8.jar on my new RaspBerry pi. I followed this tutorial: http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/RaspberryPiFX/raspberryfx.html

I was able to install Java8 but when I try to run the Ensemble8.jar (or any other small JavaFx application) I've this error:

Error: Could not find or load main class ensemble.EnsembleApp

My PATH is correct; have you some suggestion to fix the problem?

Thanks!

Answer

José Pereda picture José Pereda · Feb 2, 2015

Since the 8u33 for ARM version, Oracle has removed JavaFX from the ARM distribution, as it was announced here.

You can read some statements about this in these forums:

  • Raspberry Pi Forum (now it's offline)
  • OpenJFX Mailing list

So you won't be able to run any JavaFX application... unless you downgrade your version to the last JDK8u6 that supported JavaFX, or you provide a valid jfxrt.jar.

And you can do it following this tutorial, cross building OpenJFX for ARM, or just using some already built distribution like this one hosted on the JavaFXPorts project.

Once you have downloaded armv6hf-sdk.zip, unzip it and you need to add this command line option to attach this external source to the classpath, with the extension mechanism:

-Djava.ext.dirs=<path to armv6hf-sdk>/rt/lib/ext

For instance, you need this to run one of the JavaFX old samples from its actual path:

sudo /opt/jdk1.8.0_33/bin/java -Djava.ext.dirs=<path to armv6hf-sdk>/rt/lib/ext -jar BrickBreaker.jar