MinhTech.com

Yet another technology tutorial blog.

CentOS Install Sun Java SE JRE

By Minh • Sep 9th, 2009 • Category: Featured 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 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)

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

Leave a Reply