MinhTech.com

Yet another technology tutorial blog.

CentOS Install Sun Java SE JRE

By • Sep 9th, 2009 • Category: Featured Linux, Linux

Here is how to install the Sun Java SE Runtime Environment (JRE) on CentOS 5.3.

First, Execute the Binary:

> mv jre-6u16-linux-x64.bin /usr/lib/java
> cd /usr/lib/java
> chmod 744 jre-6u16-linux-x64.bin
> ./jre-6u16-linux-x64.bin

Download the 32-bit or 64-bit non-RPM binary from Sun’s site here and execute it.

Next, Set Sun’s Java as Default:

> update-alternatives --install "/usr/bin/java" "java" "/usr/lib/java/jre1.6.0_16/bin/java" 1
> update-alternatives --set java /usr/lib/java/jre1.6.0_16/bin/java

We configure the system to use Sun’s Java binaries to execute “java” commands by telling it there is an alternate installation and to use it by default.

Finally, Check the Default Version:

> java -version
java version “1.6.0_16″
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)

is a technology junkie.
Email this author | All posts by

3 Responses »

  1. Wow..very good…Nice blog and well updated…

  2. Very nice guide. I have a problem with the following part.

    [root@MattPC ~]# update-alternatives –set java /usr/lib/java/jre1.6.0_29/bin/java
    /usr/lib/java/jre1.6.0_29/bin/java has not been configured as an alternative for java

    Any ideas why this doesn’t work? I also still have the non SUN java as a default after this.

    Thanks

  3. A formidable share, I simply given this onto a colleague who was doing somewhat analysis on this. And he in reality bought me breakfast because I discovered it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for spending the time to discuss this, I feel strongly about it and love reading extra on this topic. If attainable, as you develop into expertise, would you mind updating your weblog with extra details? It is extremely useful for me. Massive thumb up for this weblog publish!

Leave a Reply