1.Download java
2. extract java
cp /home/hades/Downloads/jdk-8u60-linux-x64.tar.gz /opt/
3. tar xvzf jdk-8u60-linux-x64.tar.gz
4. Install control java config
#apt-get install galternatives
#galternatives
add java, javac, javaws read more info
5. configure java default
#update-alternatives --config java
6. Check java version
root@mail:/opt# java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
7. configure plugins firefox
/.mozilla$ mkdir plugins
ln -s /opt/jdk1.8.0_60/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
8. configure control security
/opt/jdk1.8.0_60/bin$ sudo sh ControlPanel
Reference:
http://askubuntu.com/questions/159575/how-do-i-make-java-default-to-a-manually-installed-jre-jdk