Raspberry Pi Zero with Java 11

How to install Java 11 into Raspberry Pi Zero ?

What’s the problem?

Raspberry Pi Zero has an ARM CPU generation ARMv6 and all default Java pre-compiled are targeted to ARMv7. So, any executable that needs ARMv7, VFP3 or something like this WON’T work on RPi Zero!


Install Java JDK 11 for ARMv6 provided by Azul called Zulu SDK. Today, the last version can be downloaded using this link

$ cd /usr/lib/jvm
$ sudo wget https://cdn.azul.com/zulu-embedded/bin/zulu11.52.13-ca-jdk11.0.13-linux_aarch32hf.tar.gz
$ sudo tar -xzvf zulu11.52.13-ca-jdk11.0.13-linux_aarch32hf.tar.gz
$ sudo rm zulu11.52.13-ca-jdk11.0.13-linux_aarch32hf.tar.gz

$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/zulu11.52.13-ca-jdk11.0.13-linux_aarch32hf/bin/java 10
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/zulu11.52.13-ca-jdk11.0.13-linux_aarch32hf/bin/javac 10

$ sudo update-alternatives --config java