Installing Java 1.6 in CentOS 6 – The Simplest Way

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:

$ cd /usr/local/src
$ rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
$ wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
$ rpm -Uhv rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

2.  Remove previous Java version 1.5, if you have it installed:

$ yum remove java-1.5-*

3. Lets install Java 1.6. The package name will be java-1.6.0-openjdk.x86_64:

$ yum install java-1.6.0-openjdk.x86_64 -y

4. We need to export the JAVA_HOME environment. This steps is optional:

$ export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre

5. Lets check our latest Java version:

$ java -version
java version "1.6.0_17"
OpenJDK Runtime Environment (IcedTea6 1.7.9) (rhel-1.36.b17.el6_0-x86_64)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)

As simple as ABC!

Was this answer helpful?

 Print this Article

Also Read

Ubuntu: Install Windows Application using Winetricks

Ubuntu is surely good for end-user operating system but sometimes we still need to have...

Install FireHOL Firewall in Debian Linux

What is FireHOL ?FireHOL is a stateful iptables packet filtering firewall configurator. It is...

Run Command in Many Servers Simultaneously

Server administrators usually have many servers to manage. There will be some time when we need...

How to Change root/user password?

Via SSH following:Passwd

Understanding Linux CPU Load - when should you be worried?

You might be familiar with Linux load averages already. Load averages are the three numbers shown...

Powered by WHMCompleteSolution