Test Pi4J Basic OS

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.

Audio Test

cd /home/pi
nvlc Music/StarTrekTheme.mp3

Pure JavaFX Application

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.

Pure Pi4J Application

Attach a button to pin 25.

  • On CrowPi that’s the left-button.
  • on Picade Console that’s the button-4-button.
  • Otherwise:

Button on Pin 25

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