Pages

Wednesday, December 3, 2014

Java 1.7.x on Debian Squeeze manual install

Recently Oracle made changes in java package license and it will be no longer shipped with Debian. Debian people said that this prevents even updates for old packages to be released. For more information read here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=649594

Here is solution how to install newer java packages manually on Debian Squeeze.

Download the package and unpack it in /usr/lib/jvm/
# zcat jdk-7u71-linux-i586.tar.gz|tar xvf -
# mv jdk1.7.0_71 /usr/lib/jvm/java-1.7
# chown -R root:root /usr/lib/jvm/java-1.7/*
Now use update-alternatives script to add it to /etc/alternatives
# update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java-1.7/bin/java" 1
# update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/java-1.7/bin/javaws" 1
# update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java-1.7/bin/javac" 1
Now set the new java binaries as default (choose the one with the right path):
# update-alternatives --config java
# update-alternatives --config javac
# update-alternatives --config javaws