Running Javafx GUI on the Raspberry Pi

后端 未结 1 479
情话喂你
情话喂你 2020-12-11 07:38

I have programs that I need to run on the Raspberry Pi and show the output on an lcd connected to the Raspberry Pi.

I have used Java for the programming and JavaFX s

相关标签:
1条回答
  • 2020-12-11 08:18

    As you can read here, the most recent JDK versions for ARM don't include JavaFX.

    If you want to use JavaFX in your Raspberry Pi, the solution is adding the missing JavaFX SDK.

    If you install the recent Oracle's JDK for ARM from here (select jdk-8u111-linux-arm32-vfp-hflt.tar.gz), then you will need to download the JavaFX SDK from Gluon's site (select JavaFX Embedded SDK for armv6 hard float).

    Once you have the file, unzip it, and copy the folders to your JDK.

    Assuming you have downloaded armv6hf-sdk-8.60.8.zip to your Pi/Downloads folder, and you have unzip it to a folder armv6hf-sdk, like in the following picture:

    using the following commands will allow you moving from command line the files to the JDK required folders. You can use a graphic tool for this as well.

    cd Downloads
    sudo chown -R root:root armv6hf-sdk
    cd armv6hf-sdk
    sudo mv lib/javafx-mx.jar /opt/jdk1.8.0_111/lib/
    cd rt/lib/
    sudo mv j* /opt/jdk1.8.0_111/jre/lib/
    sudo mv arm/* /opt/jdk1.8.0_111/jre/lib/arm/
    sudo mv ext/* /opt/jdk1.8.0_111/jre/lib/ext/ 
    

    After that you should be able to run Java/JavaFX programs.

    If you have a look also at the Gluon IDE plugins, you will be able to create projects on your desktop and deploy them remotely on your Pi (as well as on your desktop and mobile devices). Check the documentation here to set up your build script. And check the sample GluonSQLite here.

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