Install and configure your own java in RedHat (RHEL) linux

Posted By: Matpal - June 19, 2017
Often you have to install your own Java on top of what Red Hat gives you. Here is the example how you can do it.

Step 1: Download JAVA 8  from here . In this example we are downloading jdk-8u131-linux-x64.tar.gz (64 Bit Linux)

Step 2 : Copy jdk-8u131-linux-x64.tar.gz to your file /opt manually, or try following

#  cd /opt/

#  wget --no-cookies --no-check-certificate --header "Cookie:; oraclelicense=accept-securebackup-cookie" ""

#  tar xzf jdk-8u131-linux-x64.tar.gz

Step 3:

#  cd /opt/jdk1.8.0_131/

#  alternatives --install /usr/bin/java   java   /opt/jdk1.8.0_131/bin/java  2

#  alternatives --config java

Step 4 : --config java gives you following . For your newly installed java enter 3

There are 3 programs which provide 'java'.

  Selection    Command
*  1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
 + 3           /opt/jdk1.8.0_131/bin/java

Enter to keep the current selection[+], or type selection number: 3

You can check your java version now

# java –version


Post a Comment

Note: Only a member of this blog may post a comment.