JavaFX on Raspberry Pi: runfxapp

Running JavaFX Apps on RaspberryPi with JDK 8 needs still some command “overhead” like:

sudo /opt/jdk1.8.0/bin/java -Djavafx.platform=eglfb -cp \ 
/opt/jdk1.8.0/jre/lib/jfxrt.jar:/tmp/JavaFXSamples/Stopwatch.jar \ 
stopwatch.MainScreen

To start apps more conveniently I wrote a small bash-skript:
runfxapp
(as shell-skript code is ugly I skip posting it here ;-))

Copy this skript to somewhere on $PATH (e.g. /usr/local/bin) and set execution rights:

sudo chmod 755 /usr/local/bin/runfxapp

Then Apps can be executed like:

runfxapp -j /home/pi/apps/StopWatch.jar stopwatch.MainWindow

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>