Login as root.
First down load JAVA JDK 7 with command below.
For 64bit (x86_64) system
#wget –no-cookies \
–no-check-certificate \
–header “Cookie: oraclelicense=accept-securebackup-cookie” \
“http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.rpm” \
-O /opt/jdk-7-linux-x64.rpm
For 32bit (x86) system
#wget –no-cookies \
–no-check-certificate \
–header “Cookie: oraclelicense=accept-securebackup-cookie” \
“http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm” \
-O /opt/jdk-7-linux-i586.rpm
Once JAVA JDK package downloaded then proceeded with install.
Installing the JAVA JDK7 package in CentOS 6 with command below.
For 64bit (x86_64) system
#rpm -Uvh /opt/jdk-7-linux-x64.rpm
For 32bit (x86) system
#rpm -Uvh /opt/jdk-7-linux-i586.rpm