I want to write program for Raspberry Pi using JavaFX but it appears that Java SDK 8 on my Raspberry Pi does not have JavaFX support.
So my question is whether JavaFX is supported on Raspberry Pi 2/3
? If yes, why does JDK not have JavaFX libraries on the platform ? Is there a way to support it or worth writing JavaFX application on Raspberry PI ?
Java version in use is 1.8.0_65
.
In this tutorial, you install the Java Development Kit (JDK) for Java Platform, Standard Edition Release 8 (Java SE 8) on the Raspberry Pi, and then you deploy, run, and stop JavaFX applications directly and remotely in the Pi.
Oracle wrote in its Client Support Roadmap that JavaFX new fixes will continue to be supported on Java SE 8 through March 2025.
JavaFX 8 runs fine on Linux in my experience, the only requirement appears to be libgtk 2.18+. There are full details on Oracle JDK 8 and JRE 8 Certified System Configurations. Working Linux versions include: Ubuntu 10.04 (and possibly earlier, 10.04 had libgtk 2.20)
GWT, Vaadin, Qt, JSF, and Electron are the most popular alternatives and competitors to JavaFX.
If you are using Oracle JDK for ARM 8u33 / Oracle Java SE Embedded 8u33
or later, you will not find JavaFX bundled in the JDK. Oracle removed JavaFX Embedded from the ARM bundle starting from 8u33. For more information have a look at this thread from the OpenJFX mailing list.
So, can we still use JavaFX on Raspberry PI?
Well, of course you can. Here are a few ways you can still run JavaFX on embedded devices :
Your best shot is to install embedded SDK, provied by Gluon, which includes jfxrt.jar
for ARM. You can copy the jar into the JDK and have JavaFX running on Raspberry PI. Gluon further extends the support by helping users deploy there JavaFX plugin via plugin. Have a look at :
If you want to know more about JavaFX on embedded, these are some useful links :
for some reasons the above links are not working but I was able to download from https://bitbucket.org/javafxports/arm/downloads/ [dead] then unzip the folder and copy
armv6hf-sdk/rt/lib/ext/**jfxrt.jar** --> jre/lib/ext/
armv6hf-sdk/rt/lib/arm/***** --> jre/lib/arm/
armv6hf-sdk/rt/lib/**javafx.platform.properties** --> jre/lib/
armv6hf-sdk/rt/lib/**javafx.properties** --> jre/lib/
armv6hf-sdk/rt/lib/**jfxswt.jar** --> jre/lib/
Restart Raspberry Pi and FX Application worked fine
You can also download pre-built binaries from Gluon.
http://gluonhq.com/gluon-supports-javafx-embedded-binary-builds-now-available/
Yes, you can run JavaFX on Raspberry Pi but some of class library will not work by default, as example Media. Currently I'm still trying to use this Media class library to work on raspberry Pi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With