root@localhost:~# tar -xzvf jdk-7u17-linux-x64.tar.gz
jdk1.7.0_17/
jdk1.7.0_17/include/
[..]
root@localhost:~# mv jdk1.7.0_17 /opt
root@localhost:~# cd /opt/jdk1.7.0_17/
root@localhost:/opt/jdk1.7.0_17#
root@localhost:/opt/jdk1.7.0_17# update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_17/bin/java 1
root@localhost:/opt/jdk1.7.0_17# update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_17/bin/javac 1
root@localhost:/opt/jdk1.7.0_17# update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_17/jre/lib/amd64/libnpjp2.so 1
update-alternatives: /opt/jdk1.7.0_17/jre/lib/amd64/libnpjp2.so wird verwendet, um /usr/lib/mozilla/plugins/libjavaplugin.so (mozilla-javaplugin.so) im Auto-Modus bereitzustellen
root@localhost:/opt/jdk1.7.0_17# update-alternatives --set java /opt/jdk1.7.0_17/bin/java
update-alternatives: /opt/jdk1.7.0_17/bin/java wird verwendet, um /usr/bin/java (java) im manueller Modus bereitzustellen
root@localhost:/opt/jdk1.7.0_17# update-alternatives --set javac /opt/jdk1.7.0_17/bin/javac
update-alternatives: /opt/jdk1.7.0_17/bin/javac wird verwendet, um /usr/bin/javac (javac) im manueller Modus bereitzustellen
root@localhost:/opt/jdk1.7.0_17# update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_17/jre/lib/amd64/libnpjp2.so
root@localhost:/opt/jdk1.7.0_17# java -version
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)