Installing Java Manually in Debian
The following are instructions on how to manually install Sun's Java in Debian and any other Debian-based Linux distribution. Please note that VERSION is the version number of Java you are installing.
1) Download the latest JDK update from Sun. Choose the self-extracting .bin for Linux (not the RPM).
2) Perform the following commands:
# chmod +x jdk*
# ./jdk* (follow instructions)
# rm jdk*bin && mv jdk* /opt
# update-alternatives --install java java /opt/jdkVERSION/bin/java 99
# update-alternatives --config java (from here, select the correct java alternative)
3) Set the shell variables in either /etc/bash.bashrc (system-wide) or ~/.bashrc (user-specific). bash.bashrc is recommended so use a text editor to add the following to the end of it:
export JDK_HOME=/opt/jdkVERSION
export CLASSPATH=$JDK_HOME
export CLASSPATH=.:$CLASSPATH
export PATH="$PATH:${JDK_HOME}/bin:${JDK_HOME}/jre/bin"
4) To enable the plugin in Iceweasel (or Firefox) do:
$ cd ~/.mozilla/plugins/
$ ln -s /opt/jdk*/jre/plugin/i386/ns7/libjavaplugin_oji.so