This tag collects posts specifically about Java on Raspberry Pi: runtime setup, embedded programming, Pi4J integration, performance tuning, and experiments that combine software with real hardware.
The Pi4J project is a Java library that allows you to control the GPIO pins and electronic components connected to a Raspberry Pi with pure Java code. It removes the complexity of using native libraries and the Java Native Interface (JNI), allowing you to focus on your application logic.
As described before on Java 21+ Not Working on Raspberry Pi Zero 2, a problem appeared to execute Java code on the Raspberry Pi Zero 2 with OpenJDK 21 or higher. Reason: in OpenJDK 21 the Just-In-Time (JIT) compiler has been improved, but this change doesn’t work correctly on the ARM Cortex-A53 processor as used in the Zero 2. It’s another type of processor compared to, for instance, the Raspberry Pi 4 (Cortex-A72) and 5 (Cortex-A76).
Dieter Holz was experimenting with Pi4J V3 on a Raspberry Pi Zero 2. Because this version requires Java 21 or newer, he upgraded his OS to a newer Java version and found out that no Java code could be executed. He tried with Java 21 and 24, and neither worked correctly, although Java 17 runs without problems.
In this post you’ll learn how you can run a Java application on a Raspberry Pi Zero 1 to turn it in a controllable HDMI camera. I use such cameras in my setup with an ATEM Mini Pro HDMI video switcher. This allows me to have four different inputs for a very affordable price to create videos, tutorials, virtual conference talks, etc. As I wanted to be able to easily change the zoom level of these Raspberry Pi cameras, I created a small Java application with an API.
I’m one of those people with boxes full of devices, waiting to be used in experiments… And from time to time, I dive into those boxes to fill in the gaps in between other tasks. So these are the results of my first Raspberry Pi Compute Module experiments!
Last week I was working on a blog post about Azul Zulu with JavaFX support for ARM systems, like the Raspberry Pi. As you can see in this video, I found out my little test application with a lot of “bouncing balls” started losing performance on the Raspberry Pi with more than 1000 of those balls.
One of the most “fancy” electronic components is definitely a LED strip. It’s really cool to control a long strip of lights with only a few lines of code… But, there is a problem. The timing of the signals is crucial to reliably control these strips. Both Python and Java on a Raspberry Pi can struggle with these timings as they are running on Linux, a non-real-time operating system. So, for instance, pauses in the garbage collection of the Java virtual machine, or any glitch in the operating system can cause unexpected effects on the LED strips. That’s why in most projects, a microcontroller (Arduino, Raspberry Pi Pico, ESP32,…) is used to drive the LED strip.
In my search for a good solution to use LED strips with Java, I stumbled on the Pixelblaze Output Expander. This small device is controlled through a serial interface, and handles the control of the LED strip. As it turns out, this is a perfect solution to offload the timing-critical operations from the Raspberry Pi and have reliable output on a LED strip.
Yes, the Raspberry Pi Operating System is awesome! But the Pi4J project made it if even more awesome by adding “goodies” for Java developers! Pi4J OS is not yet another OS, but the official Raspberry Pi OS, with additional tools and preconfigurations to make it the ideal OS for any Java and JavaFX developer who wants to use a Raspberry Pi.
With the April release of the Zulu Build of OpenJDK, Azul announced the integration of CRaC in its version 17 of Java for Linux. Coordinated Restore at Checkpoint (CRaC) is a feature introduced in OpenJDK to improve Java’s application startup and warmup times to milliseconds from seconds or even minutes, by allowing a running application to pause, snapshot its state, and restart later, even on a different machine.
Writing has always been my passion, and even in my previous jobs as a developer, I stood out as the one who enjoyed creating and maintaining documentation. But June 9th, 2023, marked my first birthday as a full-time technical writer at Azul. Yes, it’s already a year ago that I changed from being a developer-who-also-writes to a writer-who-also-develops. Let’s take a moment to reflect on my incredible journey over the past year.
Is Java your first programming language and do you want to get up and running fast? Or maybe you are already an experienced programmer in another language and want to give Java a try?