Saturday, September 8, 2018

RaspberryPi + JDK: updating to oracle JDK 8

  Although Java 11 is knocking on the door there is still need to run device like RaspberryPi Zero on Java 8. 
This short blog post is for those they want to run Oracle JDK on Raspberry Pi/Zero.

1. download from official oracle web site JDK : Linux ARM 32 Hard Float ABI
2. upload the downloaded file to you device
3. unzip it : $sudo tar zxvf jdk-8u181-linux-arm-vfp-hflt.tar.gz -C /opt

No set the default javac and java
4. set javac: $sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_181/bin/javac 1
5. set java: $sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_181/bin/java 1
6. update javac and java
$sudo update-alternatives --config javac
$sudo update-alternatives --config java

Device is ready and running on Java 8 JDK:
$java -version 
$javac -version

Congratulation and have a fun!

No comments: