Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can JavaFX be used on Raspberry Pi

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.

like image 366
Ahmed Avatar asked Apr 30 '16 22:04

Ahmed


People also ask

Can Raspberrypi run JavaFX?

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.

Is JavaFX still supported?

Oracle wrote in its Client Support Roadmap that JavaFX new fixes will continue to be supported on Java SE 8 through March 2025.

Does Linux support JavaFX?

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)

What can I use instead of JavaFX?

GWT, Vaadin, Qt, JSF, and Electron are the most popular alternatives and competitors to JavaFX.


4 Answers

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 :

    • Getting Started for Embedded
    • Building and Deploying for Embedded
  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 :

  • Cross Building for ARM Hard Float
  • Where's JavaFX in recent Java 8u33 for the ARM ?
  • For JavaFX 11, one can read JavaFX 11 early access on embedded.
like image 119
ItachiUchiha Avatar answered Oct 07 '22 18:10

ItachiUchiha


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

like image 42
Gopi Krishna Avatar answered Oct 07 '22 20:10

Gopi Krishna


You can also download pre-built binaries from Gluon.

http://gluonhq.com/gluon-supports-javafx-embedded-binary-builds-now-available/

like image 40
mipa Avatar answered Oct 07 '22 18:10

mipa


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

like image 42
Alex Avatar answered Oct 07 '22 20:10

Alex