Pi4J Operating System

Yes, Raspberry Pi OS is great! And we made if even more awesome by adding some “goodies” for Java developers! So, to be clear, Pi4J OS is not yet another OS. It’s the official Raspberry Pi OS, with additional tools and preconfigurations to make it the ideal OS for any Java developer who wants to use a Raspberry Pi.

For Raspberry Pi 3 and 4

Pi4j OS doesn’t work on the Raspberry Pi 5.

Because of changes in the Raspberry Pi Operating System related to the release of the Raspberry Pi 5, the Pi4J OS is currently only compatible with the Raspberry Pi 3 and 4.

For the Raspberry Pi 5, you can achieve the same kind of features by starting with a standard installation as described here. After starting the Raspberry Pi, you can install Java and everything you need to build Pi4J on the Raspberry Pi, using the following script:

#!/bin/bash -e
sudo raspi-config nonint do_i2c 0
sudo raspi-config nonint do_ssh 0
sudo raspi-config nonint do_serial_hw 0
sudo raspi-config nonint do_serial_cons 1
sudo raspi-config nonint do_onewire 0
sudo systemctl disable hciuart
echo "dtoverlay=disable-bt" | sudo tee -a /boot/firmware/config.txt

sudo apt install -y i2c-tools vim git java-common libxi6 libxrender1 libxtst6
curl -s "https://get.sdkman.io" | bash
source .bashrc
sdk install maven

mkdir -p ~/Downloads
cd ~/Downloads
wget https://cdn.azul.com/zulu/bin/zulu21.34.19-ca-jdk21.0.3-linux_arm64.deb
sudo dpkg -i zulu21.34.19-ca-jdk21.0.3-linux_arm64.deb

You can execute all this with one script using the following command:

curl -s "https://raw.githubusercontent.com/eitch/pi4j-test/develop/src/assembly/setup.sh" | bash

Additional Features on top of Raspberry Pi OS

This project provides pre-built versions of OS images with all you need to develop 100% pure Java applications for specific Raspberry Pi setups. They are based on the latest official Raspberry Pi OS and are automatically built using Packer.

By using these images, you will get:

  • Preconfigured locale (en_US), keyboard (US) and timezone (Europe/Zurich).
  • Preconfigured wireless country (Switzerland) by default.
  • Remote management via SSH and VNC enabled by default.
  • Preinstalled OpenJDK 17 with latest JavaFX 20.
  • Starter script to launch JavaFX-apps in DRM (aka kiosk-mode).
  • Preconfigured /boot/config.txt supporting all components out of the box.
  • Dynamic wallpaper showing Ethernet/WLAN address and hostname.
  • User account pi, password pi4j.
    • You have to set the corresponding preferences in Raspberry Pi Imager.
  • Default WLAN connection.
    • Setup a hotspot, for example on your smartphone, and you’re ready to go.
      • SSID: Pi4J-Spot.
      • Password: MayTheSourceBeWithYou!.
    • Your laptop has to be in the same WLAN as the Rasperry Pi.

Available Flavors

Pi4J-Basic-OS

Download latest release of Pi4J-Basic-OS Image

Pi4J-CrowPi-OS

  • All of Pi4J-Basic-OS
  • Support for CrowPi
  • Comes with lirc preinstalled to run the IR receiver component
  • Use CrowPi template project to start your CrowPi experiments

Download latest release of Pi4J-CrowPi-OS

Pi4J-Picade-OS

Download latest release of Pi4J-Picade-OS

Table of content of the “Pi4J OS” section