To Install Java in CentOS :
Download java from the any website, jdk-6u30-linux-x64.bin file and continue the following steps,
a) move the downloaded file to /opt
>mv jdk-6u30-linux-x64.bin /opt
b) change the ownership of the downloaded file.
>chmod 766 jdk-6u30-linux-x64.bin
c) extract the downloaded file,
>./jdk-6u30-linux-x64.bin
d) to install, follow the below command
>alternatives –install /usr/bin/java /opt/jdk1.6/bin/java 1
e) to select the versions of the java installed in the system and choose the version needed
> alternatives –config java
Very Good one… well written article….