How to install the latest JDK from Oracle on Debian Linux

  • Debian version: Wheezy 64 bit

  • Oracle jdk version: 1.7

this guide is base on

download (NOTE: Adapt the below to match the latest version!!! See

wget --no-cookies --header "Cookie:" "" -O /tmp/jdk-7-linux-x64.tar.gz --no-check-certificate

Unpack the downloaded JAVA 7 archive in /opt

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

Set-up Oracle’s JAVA 7 to be used on the system, by using higher priority with update-alternatives (NOTE: Adapt the below to match the latest version !!!)

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

TODO: how to remove java and javac from update-alternatives

Add picture from clipboard (Maximum size: 40 MB)