Can JavaFX be used on Raspberry Pi

后端 未结 7 1366
甜味超标
甜味超标 2020-12-25 15:08

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 Java

相关标签:
7条回答
  • 2020-12-25 15:30

    for some reasons the above links are not working but I was able to download from https://bitbucket.org/javafxports/arm/downloads/ 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

    0 讨论(0)
  • 2020-12-25 15:33

    The question is already a bit old but as of today one could also download and install the latest JDK from Bellsoft which also includes the latest JavaFX. https://www.bell-sw.com/pages/java-11.0.2/

    0 讨论(0)
  • 2020-12-25 15:37

    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

    0 讨论(0)
  • 2020-12-25 15:38

    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.
    0 讨论(0)
  • 2020-12-25 15:41

    You can also download pre-built binaries from Gluon.

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

    0 讨论(0)
  • 2020-12-25 15:45

    If someone still arrives here, I would like to point out an article I wrote and demonstrates exactly this: https://blogs.oracle.com/javamagazine/getting-started-with-javafx-on-raspberry-pi. As mipa answered, BellSoft LibericaJDK is indeed a perfect JavaJDK to work with JavaFX on the Raspberry Pi.

    0 讨论(0)
提交回复
热议问题