Saturday, May 20, 2017

Be ready and prepare Raspberry Pi for Java 9

   Java 9 is coming soon with many new features. Aside of continued discussion about Project Jigsaw impact, it's time to get prepared.
This article helps you to prepare your RaspberryPi environment with multiple installed JDKs.
Whole process is quite straight forward: 

The first step is to download the last stable release of java jdk-9. 
In the article we use the most recent build: jdk-9+170

You can download JDK directly into your RapsberryPi or your local machine and then by using $scp command upload it to your RaspberryPi machine
$scp ./jdk-9-ea+170_linux-arm32-vfp-hflt_bin.tar.gz pi@<raspberrypi_ip>/home/pi

The next step is to login into your RaspberryPi machine  
$ssh pi@<raspberry_ip>

To unzip the downloaded JDK file execute following command:
$ sudo tar zxvf jdk-9-ea+170_linux-arm32-vfp-hflt_bin.tar.gz -C /opt

The command extracts the jdk-9 into the /opt folder

Now link java and javac with newly available JDK
$ sudo update-alternatives --install /usr/bin/javac javac /opt/jdk-9/bin/javac 1
$ sudo update-alternatives --install /usr/bin/java java /opt/jdk-9/bin/java 1

by using following command we select the jdk-9 available for us under the number 1
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java

at the end we verify our current java version by:
$ java -version
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+170)
Java HotSpot(TM) Client VM (build 9-ea+170, mixed mode)

$ javac -version
javac 9-ea

Congratulation your RaspberryPi is now running on Java 9 and you can switch between JDKs.


  1. I have to voice my passion for your kindness giving support to those people that should have guidance on this important matter.
    Java Training in Marathahalli

  2. That was a very nice and interesting post.

    Please click on the link below.
    Advanced Excel Courses in Bangalore

  3. This comment has been removed by the author.

  4. Really awesome blog. Your blog is really useful for me. Thanks for sharing this informative blog. Keep update your blog...Java Training in Chennai
    Java Training Institute in Chennai

  5. I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.
    AWS Training in Bangalore

  6. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training from India . Nowadays Java has tons of job opportunities on various vertical industry.

  7. Hi Thanks for the nice information its very useful to read your blog. We provide best Software Services

  8. I have to voice my passion for your kindness giving support to those people that should have guidance on this important matter.

    white label website builder