Installation of Oracle Java 1.6.0_45 on CentOS /RHEL 6.x

Learn | Teach Open Source Technologies

Installation of Oracle Java 1.6.0_45 on CentOS /RHEL 6.x

Download jdk-6u45-linux-x64-rpm.bin

 http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html

[root@terracotta-02 downlaod]# ./jdk-6u45-linux-x64-rpm.bin

Unpacking…

Checksumming…

Extracting…

UnZipSFX 5.50 of 17 February 2002, by Info-ZIP ([email protected]).

inflating: jdk-6u45-linux-amd64.rpm

inflating: sun-javadb-common-10.6.2-1.1.i386.rpm

inflating: sun-javadb-core-10.6.2-1.1.i386.rpm

inflating: sun-javadb-client-10.6.2-1.1.i386.rpm

inflating: sun-javadb-demo-10.6.2-1.1.i386.rpm

inflating: sun-javadb-docs-10.6.2-1.1.i386.rpm

inflating: sun-javadb-javadoc-10.6.2-1.1.i386.rpm

Preparing…                ########################################### [100%]

1:jdk                    ########################################### [100%]

Unpacking JAR files…

rt.jar…

jsse.jar…

charsets.jar…

tools.jar…

localedata.jar…

plugin.jar…

javaws.jar…

deploy.jar…

Installing JavaDB

Preparing…                ########################################### [100%]

1:sun-javadb-common      ########################################### [ 17%]

2:sun-javadb-core        ########################################### [ 33%]

3:sun-javadb-client      ########################################### [ 50%]

4:sun-javadb-demo        ########################################### [ 67%]

5:sun-javadb-docs        ########################################### [ 83%]

6:sun-javadb-javadoc     ########################################### [100%]

 

  1. Make sure the file is executable:
    chmod +x jdk-6u23-linux-x64.bin
  2. Next run the installer:
    ./jdk-6u23-linux-x64.bin
    At the end of the installation just hit enter.
  3. Remove the installation package:
    rm -f jdk-6u23-linux-x64.bin
  4. Finally, we need to add a symbolic link to the Java executable:
    ln -s /usr/java/jdk1.6.0_23/bin/java /usr/bin/java
    I assumed you only want to have one version of Java installed. Just in case you already have another Java version installed and you want to be able to flexibly choose among those versions, you can establish the symbolic link with the alternatives command:
    alternatives –install /usr/bin/java java /usr/java/jdk1.6.0_23/bin/java 2
    alternatives –config java
    Choose the Java version you want to have referenced.

That’s it! Type java -version on the command line and you should get a similar result to this:

java version “1.6.0_23”
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) 64-Bit Server VM (build 19.0-b09, mixed mode)

Finally, you might want to add the environment variable JAVA_HOME (which is needed by Apache Tomcat server, for example). To do so, simply type this command in your command line:

echo “export JAVA_HOME=/usr/java/jdk1.6.0_23” >> /etc/profile

This commando will write the JAVA_HOME environment variable to the file /etc/profile which contains system wide environment configuration.

Here you go. Enjoy running Java applications on your CentOS system!

 

 

Comments are closed.