Installing Oracle JDK 8 on Raspberry Pi





For installing the latest version of Oracle JDK on Raspberry Pi 3 follow the steps here.

Visit http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html, click the download button of Java Platform (JDK) 8. Click to Accept License Agreement, download jdk-8-linux-arm-vfp-hflt.tar.gz for Linux ARM v6/v7 Hard Float ABI.


Log-in Raspberry Pi, enter the command to extract jdk-8-linux-arm-vfp-hflt.tar.gz to /opt directory.
$ sudo tar zxvf jdk-8-linux-arm-vfp-hflt.tar.gz -C /opt

Set default java and javac to the new installed jdk8.
$ sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0/bin/javac 1
$ sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0/bin/java 1

$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java

After all, verify with the commands with -verion option.
$ java -version
$ javac -version



10 comments

  1. Thanks -- this helped me, even though I was using the Oracle Java SE Embedded -- same principles at work.

    ReplyDelete
  2. FYI, 'sudo apt-get install oracle-java8-jdk' worked for me, now that it is included in the Raspbian repos.

    ReplyDelete
  3. Put this at the end of your /etc/profile
    export JAVA_HOME="/path/to/java/jdk"
    export PATH=$PATH:$JAVA_HOME/bin

    ReplyDelete
  4. Thankyou! This helped fix the recent issues with my.openHAB servers moving to letsencrypt.org certificates and requiring a java update!

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. use command:
    wget --no-check-certificate \
    http://www.java.net/download/jdk8/archive/b132/binaries/jdk-8-fcs-b132-linux-arm-vfp-hflt-03_mar_2014.tar.gz

    to download java file from pi command line

    ReplyDelete