Table of Content
1) download jdk
download *.tar.gz from Oracle Java site, this version can be unpacked at local location, don’t need to uninstall current default jdk on system.
jdk-7u-linux-i586.tar.gz JDK 7 jdk-7u -linux-x64.tar.gz JRE 7 64 bits
2) unzip jdk
cd /usr/jdk/ gunzip *.tar.gz|tar xvf - /usr/jdk/jdk-1.7.0_21 // new jdk 7
3) remove /usr/java
this is softlink to old jdk jdk1.7.0_07
# cd /usr # ls -ltra java lrwxrwxrwx 1 root root 15 Nov 11 02:56 java -> jdk/jdk1.7.0_07 # rm java
4) re-create java softlink
# cd /usr # ln -s jdk/jdk-1.7.0.21 java # ls -ltra java lrwxrwxrwx 1 root root 16 Apr 28 16:20 java -> jdk/jdk1.7.0_21/
5) update path for jdk
export PATH=$PATH:/usr/jdk/jdk1.7.0_21/bin
6) or update path in /etc/bash/bashrc
export PATH=/usr/bin:/usr/sbin:/usr/jdk/jdk1.7.0_21/bin