Wednesday, 30 May 2018

Step by Step Installation process of JAVA 8 on RHEL7/CentOS7

[root@sankar-devops ~]# cd /opt
[root@sankar-devops opt]#
[root@sankar-devops opt]# pwd
/opt
[root@sankar-devops opt]#

[root@sankar-devops opt]# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz"

[root@sankar-devops opt]# ls -l
total 186420
-rw-r--r--. 1 root root 190890122 Apr  3 23:35 jdk-8u171-linux-x64.tar.gz
[root@sankar-devops opt]#

[root@sankar-devops opt]# tar -xvzf jdk-8u171-linux-x64.tar.gz 

[root@sankar-devops opt]# ls -ltrh
total 183M
drwxr-xr-x. 8   10  143  255 Mar 29 05:48 jdk1.8.0_171
-rw-r--r--. 1 root root 183M Apr  3 23:35 jdk-8u171-linux-x64.tar.gz

[root@sankar-devops opt]# mkdir jdk

[root@sankar-devops opt]# mv jdk1.8.0_171 /opt/jdk/

[root@sankar-devops jdk1.8.0_171]# pwd
/opt/jdk/jdk1.8.0_171


[root@sankar-devops jdk1.8.0_171]# vi ~/.bashrc 


export JAVA_HOME=/opt/jdk/jdk1.8.0_171
export PATH=$PATH:$JAVA_HOME/bin
:wq!

[root@sankar-devops jdk1.8.0_171]# source  ~/.bashrc 
[root@sankar-devops jdk1.8.0_171]#

[root@sankar-devops jdk1.8.0_171]# update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_171/bin/java 100
[root@sankar-devops jdk1.8.0_171]#

[root@sankar-devops jdk1.8.0_171]# java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
[root@sankar-devops jdk1.8.0_171]# 

No comments:

Post a Comment