The Pi4J Basic OS contains two simple applications in directory java-examples
and a sample file to test the audio channel. As Pi4J CrowPi OS and Pi4J Picade OS are based on Pi4J Basic OS, they also contain these tests.
You can start the tests via ssh
.
cd /home/pi
nvlc Music/StarTrekTheme.mp3
Compile the JavaFX application
cd /home/pi/java-examples/pure-javafx
javac --module-path /opt/javafx-sdk/lib --add-modules=javafx.controls,javafx.media hellofx/HelloFX.java
To start HelloFX
in X11-Mode
DISPLAY=:0 XAUTHORITY=/home/pi/.Xauthority sudo -E java --module-path /opt/javafx-sdk/lib --add-modules javafx.controls,javafx.media -Dglass.platform=gtk hellofx.HelloFX
To start HelloFX
in DRM (Direct Rendering Mode)
sudo java-kiosk hellofx.HelloFX
java-kiosk
is a command provided by our image. It assures to call java
with the correct (and huge) set of parameters.
Attach a button to pin 25
.
left
-button.button-4
-button.Compile and start the Java application
cd /home/pi/java-examples/pure-pi4j
javac -cp "/home/pi/deploy/*:." hellopi4j/MinimalPi4J.java
sudo java -cp "/home/pi/deploy/*:." hellopi4j.MinimalPi4J