Looking at my blog statistics shows that my post on “Installing the latest JRE 6 on CentOS” is one of the top positions. Also a lot of search engines referrals come to this post.
Thus I would like to give a short update to the blog post, since some things have changed since then. Also CentOS has been updated to Version 5.2 in the meantime.
The way I have done it with modifying the symbolic link in “/usr/bin/java/” still works, but it is not the recommended way to do it. Thus I follow here the path that the CentOS project has outlined. Where applicable I updated the link information. So, without further ado, let’s install JRE 6 or update it to the latest Version (update 6 for 6) as of today (06/26/2008).
- Install the “jpackage-utils” (should already be installed) with;
“yum install -y jpackage-utils”
- Download the JRE 1.6 from Sun. Grab the one that with “…RPM in self-extracting file”.
- Make the downloaded “bin” file executable and run the installation. Enter;
“chmod +x jdk-6u1-linux-i586-rpm.bin”
and follow with;
This will give you the RPM file to install.
- Next, download the needed add on package from:
http://mirrors.dotsrc.org/jpackage/1.7/generic/non-free/RPMS/ The file you should download starts with “java-1.6-sun……..”. Got it? Let’s continue.
- Now install both RPM’s with;
“rpm -Uvh jdk-6u6-linux-i586.rpm”
“rpm -Uvh java-1.6.0-sun-compat-1.6.0.06-1jpp.i586.rpm”
(Since you might already have a older version of Java 6 installed the first will tell you that it is installed and will abort the installation. Thus separating the two installations.)
- IF you have already modified the symbolic link under “/usr/bin/java/” then you should remove this link now! Simply issue a;
“rm -f /usr/bin/java”
- Now with the “alternative” system you can switch between the JVM easy. Since we want to have 1.6 running you need to set this in the alternatives. Luckily this is simply done with;
“/usr/sbin/alternatives –config java”
You should now see the following;
Enter “2″ into the selection prompt. The system has now changed the Java runtime for you to the new 6 release.
- Test it with;
“java -version” and you should get this;
That’s it. You are all set with the latest Java update. With future updated of Java all you need to do is to download the JRE from Sun and install it.
Remember if you set the JAVA_HOME variable in your profile to update it as well to the new installation!