<< PiJava - Part 2: Installing and running Java 11 on a Raspberry PI 3 Model B+
Tafelspelletjes >>

PiJava - Part 1: Trying to run Java 11 on an old Raspberry PI

2019-02-28 12:36:26
TL;DR; It doesn't work with an old PI, buy a recent one ;-)

This article is included with a lot more additional info in my book-in-progress Getting started with Java on the Raspberry Pi.
One of my goals for 2019 is experimenting with the latest Java and JavaFX versions on a Raspberry PI. After my experiments with the Python Pong game I was not very happy with the GUI I could build with Python and definitely wanted to try something similar, but with JavaFX which I like much more.

Tools used for first experiments

  • Raspberry PI board left-over, Model B+ V1.2 from 2014
  • 7" touch screen from earlier experiments, similar to this one
  • Kano kit for keyboard and WiFi
  • Latest Raspbian OS

Starting point

I started with this step-by-step from Gluon to get Java 11 running on the board.

The Java version they are using (Liberica from BellSoft) only returned "Illegal argument" exception. Thanks to Michael Röschter from Azul Systems I also got two different versions of the embedded Zulu version they build. But those gave me "error while loading shared libraries". So what is going wrong?

Inside information about the PI board

I had to look "inside" the PI to know what is going wrong and why. So it is important to be able to know exactly what is inside the PI being used. So back to my best friend Stackoverflow to get some assistance and find some tips and tricks ;-)

In this GitHub repo I added some scripts based on what I found on-line, which can help you to identify the hardware and software of the PI you are using.


This script will read out different parameters of the system to give you an overview of the Debian Linux and kernel version.
Debian version: 9.6
Kernel version: 4.14.79+

Full version info:
Linux raspberrypi 4.14.79+ #1159 Sun Nov 4 17:28:08 GMT 2018 armv6l GNU/Linux

Even more version info:
Linux version 4.14.79+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1159 Sun Nov 4 17:28:08 GMT 2018


This script helps you to define which float system is used by the Debian system.

Hard float means floating number calculations are done with a dedicated block in the chip. And soft float is done in software. So the hard float will be faster but needs a chip which supports it. And the filesystem and tools also need to be build to match the floating type.
Soft float?
   By checking dpkg for armel (if > 0): 0
   By checking if directory exists: No

Hard float?
   By checking dpkg for armhf (if > 0): 1063
   By checking if directory exists: Yes

dpkg architecture: armhf


This script helps you to define which hardware is used (processor model) and some other stuff like temperature, memory in use...
CPU info: 
processor	: 0
model name	: ARMv6-compatible processor rev 7 (v6l)
BogoMIPS	: 697.95
Features	: half thumb fastmult vfp edsp java tls 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xb76
CPU revision	: 7

Hardware	: BCM2835
Revision	: 0010
Serial		: 000000002d2617a6

CPU current values: 

Memory:               total        used        free      shared  buff/cache   available
Mem:           433M         67M        184M        3,4M        181M        314M
Swap: 99M 0B 99M

Trying-out with a Pi Zero

Quick additional experiment: same SD-card in a Pi Zero. But same "Illegal argument" result.

Side-note: isn't this remarkable. Swapping the SD-card between different Pi's, even completely different types just works. No driver changes needed, no new downloads. Just exchange the SD, power-up and start working! Isn't the Pi a really remarkable, well-built device?!


Based on the hardware version, Michael pointed out that "your Raspberry is a pre-2015 version with an ARMv6 chip. I fear the community has to wait till some commercial hardware vendor goes for Java 11 on a low-end ARMv6 chip, which is increasingly unlikely. On ARM is not easy to build a binary that works on every 32bit version. V5, V6 (two variants) and V7 are too different." BTW, also the Pi Zero is an ARMv6-type.

I you look at the overview of Pi-specs on Wikipedia it's clear which boards are supported and which aren't. Looking at the "Instruction set" row, immediately shows which types are based on the ARMv7/8 and which should be supported by the Java 11 of Liberica.

So Java 11 is not (yet) built for my old Raspberry PI...
In the meantime I bought a new one and started all over again.
Spoiler alert: it works "out of the box", but more about that in the next blog.

Related posts

ENPiJava overview: Java 11 and JavaFX 11 on Raspberry PI
As my daily work mainly is Java and back-end stuff on "real servers", I set myself for 2019 as a personal goal to experi...

ENPiJava - Part 6: JavaFX 11 application on Raspberry PI with TilesFX and GPIO
What we will do Based on the previous blog posts we can install and run Java 11 we have a minimal JavaFX 11 applica...
ENPiJava - Part 5: Running the minimal JavaFX 11 application on Raspberry PI
In part 2 of this blog series Java 11 was successfully installed on a PI. And in part 4 a running Java FX jar was gen...
ENPiJava - Part 4: Building a minimal JavaFX 11 application with Maven
I prefer a Java app above a web app, because starting a new "modern" web development requires you to pull a bunch of dep...
ENPiJava - Part 3: What is Java FX?
What is JavaFX? From the Oracle site: "JavaFX is a set of graphics and media packages that enables developers to design...
ENPiJava - Part 2: Installing and running Java 11 on a Raspberry PI 3 Model B+
After my first (and failed) attempt to get Java 11 running on an old Raspberry PI, I bought a brand new 3 Model B+ versi...
ENPiJava - Part 1: Trying to run Java 11 on an old Raspberry PI
One of my goals for 2019 is experimenting with the latest Java and JavaFX versions on a Raspberry PI. After my experimen...