Default repository in CentOS 6 will give you Java 1.5 JRE and SDK packages. I will show you on how to install version 1.6 using yum. You just need to enable RPMforge repository and another simple steps required after that.
Variables as follow:
OS: CentOS 6 64bit
Current Java version: 1.5
Upgraded Java version: 1.6
1. Install RPMforge into yum repository:
2. Remove previous Java version 1.5, if you have it installed:
3. Lets install Java 1.6. The package name will be java-1.6.0-openjdk.x86_64:
4. We need to export the JAVA_HOME environment. This steps is optional:
5. Lets check our latest Java version:
As simple as ABC!