Wednesday, September 17, 2014

Installing Java on Linux

We had a requirement to install java in Linux machine without using the RPM and below are the steps we have done.I am just putting it here for future reference.

1.    Download the server JRE from oracle.com

2.    Change to the directory in which you want to install.
           For example, to install the software in the /u01/java/ directory, Type:
           cd /u01/java/

3.    Move the .tar.gz archive binary to the current directory.

4.    Unpack the tarball and install Java
           For example,  tar zxvf server-jre-7u65-linux-x64.tar.gz 
           The Java files are installed in a directory called jdk1.7.0_65


    To make this Java installation to be available in a system-wide location such as /usr/bin, you must login as the root user and find the current java installation using command  “$which java”

Remove the existing symbolic link and create new using the below commands.

[soa.admin]$ which java
/usr/bin/java

[soa.admin]$ cd /usr/bin/

To remove the existing symbolic link
[soa.admin]$ rm java

[soa.admin]$ ln -s /u01/java/jdk1.7.0_65/bin/java java

[soa.admin]$ java -version
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

This java version is now available for all the users.


If you would like to set the JAVA_HOME for only for the current session $ export  JAVA_HOME=/u01/java/jdk1.7.0_65

No comments:

Post a Comment