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
Thx, worked like a charm!
ReplyDeleteOutstanding! Thank you.
ReplyDeleteWorked real good!
ReplyDeleteThanks -- this helped me, even though I was using the Oracle Java SE Embedded -- same principles at work.
ReplyDeleteFYI, 'sudo apt-get install oracle-java8-jdk' worked for me, now that it is included in the Raspbian repos.
ReplyDeletePut this at the end of your /etc/profile
ReplyDeleteexport JAVA_HOME="/path/to/java/jdk"
export PATH=$PATH:$JAVA_HOME/bin
Thankyou! This helped fix the recent issues with my.openHAB servers moving to letsencrypt.org certificates and requiring a java update!
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThank :)
ReplyDeleteuse command:
ReplyDeletewget --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