Can JavaFX be used on Raspberry Pi

Ahmed picture Ahmed · May 1, 2016 · Viewed 19.6k times · Source

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.

Answer

ItachiUchiha picture ItachiUchiha · May 1, 2016

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 :

  1. 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 :

  2. You can use a previous version of Oracle JDK which bundles JavaFX with it.
  3. You can also build the OpenJFX and add it to your JDK (not an easy way).

If you want to know more about JavaFX on embedded, these are some useful links :