Update on installing JRE 6 on CentOS

2008 June 26

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).

  1. Install the “jpackage-utils” (should already be installed) with;
    “yum install -y jpackage-utils”
  2. Download the JRE 1.6 from Sun. Grab the one that with “…RPM in self-extracting file”.
  3. Make the downloaded “bin” file executable and run the installation. Enter;
    “chmod +x jdk-6u1-linux-i586-rpm.bin”
    and follow with;
    “./jdk-6u1-linux-i586-rpm.bin”
    This will give you the RPM file to install.
  4. 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.
  5. Now install both RPM’s with;
    “rpm -Uvh jdk-6u6-linux-i586.rpm”
    and
    “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.)
  6. 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”
  7. 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.
  8. 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!

  • Facebook
  • Digg
  • TwitThis
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • MisterWong
  • StumbleUpon

If you enjoyed this post, make sure you subscribe to my RSS feed!

8 Responses leave one →
  1. 2008 June 29
    yiannis permalink

    nice thanks!

    also if you need to remove an existing java package

    find the installed package
    rpm -qa | grep jdk

    remove existing installation

    rpm -e jdk-1.6.0_06-fcs

  2. 2008 June 30

    This is a very beautiful site. This site is very helpful and clean.

  3. 2008 September 8
    Aaron M. Long permalink

    An excellent writeup that makes a confusing and difficult process simple. Many thanks.

  4. 2008 December 4
    Ralph permalink

    I have been unable to get either jdk 1.5 or 1.6..rpm.bin to install on Centos 5.2. I keep getting the error (below) that the file appears to be corrupted, even though I've re-downloaded them from a couple different computers.

    I have also been unable to download either of these files if I used Sun Download Manager, which starts to download for a second, then fails and retries a few times until it times out. That shouldn't be a problem, because I have been able to download without SDM.

    Has anyone else had this problem? Does anyone have a link to a known good version of these files? Thanks in advance, Ralph.

    "Do you agree to the above license terms? [yes or no]
    yes
    Unpacking…
    Checksumming…
    The download file appears to be corrupted. Please refer
    to the Troubleshooting section of the Installation
    Instructions on the download page for more information.
    Please do not attempt to install this archive file."

  5. 2008 December 8

    Hi Ralph

    Maybe you should check your CentOS installation. Are the permissions set correctly for your user who is downloading and extracting files? Is your system up to date? Maybe removing all Java packages with "yum" and then reloading them would help?

  6. 2009 March 29
    Mongo permalink

    Very good page.
    But I’ve obtained this error.
    Any idea to hwo to fix ?
    Thanks

    # rpm -ivh java-1.6.0-sun-compat-1.6.0.06-1jpp.i586.rpm
    attention: java-1.6.0-sun-compat-1.6.0.06-1jpp.i586.rpm: Entête V3 DSA signature: NOKEY, key ID c431416d
    erreur: Dépendances requises:
    jdk = 2000:1.6.0_06-fcs est nécessaire pour java-1.6.0-sun-compat-1.6.0.06-1jpp.i586

  7. 2009 March 29
    Mongo permalink

    Hello SixSigns.
    I am trying to install the latest java jdk 6u13.
    But I do not find the java-1.6.0-sun-1.6.0.13-1jpp.nosrc.rpm
    http://mirrors.dotsrc.org/jpackage/1.7/generic/SRPMS.non-free/ has only sun-1.6.0.11 available.
    Or is it possible to obtain the jdk-6u11-linux-i586.bin because only the 6u13 seems to be available on sun website.
    Thanks

Trackbacks & Pingbacks

  1. SixSigns Blog » Installing the latest JRE 6 on CentOS 5

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS

nitai@sixsigns.com