Project

General

Profile

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 https://d.stavrovski.net/blog/installing-oracle-java7-on-debian-wheezy/

download (NOTE: Adapt the below to match the latest version!!! See http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html)

wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz" -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 !!!)

jhome=/opt/java-oracle/jdk1.7.0
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)