Project

General

Profile

How to install the latest JDK 1.8 from Oracle on Debian Linux


this guide is base on

Download jdk 1.8 from here https://www.java.com/en/download/

Unpack the downloaded JAVA 8 archive in /opt

mkdir /opt/java-oracle
tar -zxf /tmp/jdk-8-linux-x64.tar.gz -C /opt/java-oracle

create a symlink with the major release version

ln -fs jdk1.8.0 jdk1.8

set-up oracle’s java 8 to be used on the system, by using higher priority with update-alternatives (NOTE: Adapt the below to match the latest version !!!)

jhome=/opt/java-oracle/jdk1.8
update-alternatives --install /usr/bin/java java ${jhome}/bin/java 2000
update-alternatives --install /usr/bin/javac javac ${jhome}/bin/javac 2000
update-alternatives --install /usr/bin/jconsole jconsole ${jhome}/bin/jconsole 2000
update-alternatives --install "/usr/bin/javaws" "javaws" "${jhome}/bin/javaws" 2000

update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" ${jhome}/jre/lib/amd64/libnpjp2.so" 1
IMPORTANT choose the java you installed as default
update-alternatives --config java
update-alternatives --config javac
Add picture from clipboard (Maximum size: 40 MB)