If you want to use the Oracle / Sun version and upgrade Java version:
wget --no-cookies --header "Cookie: gpw_e24=xxx;" http://download.oracle.com/otn-pub/java/jdk/7u25-b15/jdk-7u25-linux-x64.rpm
install...
sudo rpm -i jdk-7u1-linux-i586.rpm
Check Java home and will probably be: /usr/lib/jvm/jreecho $JAVA_HOME
change to path to JDK you installed:
export JAVA_HOME=/usr/java/jdk1.7.0_25
export PATH=$PATH:
/usr/java/jdk1.7.0_25/bin
More here:
https://gist.github.com/tankchintan/1335220
and here:
http://www.cyberciti.biz/faq/linux-unix-set-java_home-path-variable/