Thursday, 19 April 2018

How to Install Java 10 JDK on Linux Box

[root@sankar-devops java]# wget http://download.oracle.com/otn-pub/java/jdk/10.0.1+10/fb4372174a714e6b8c52526dc134031e/jdk-10.0.1_linux-x64_bin.tar.gz


100%[============================================================================================>] 5,307       --.-K/s   in 0s      


2018-04-19 09:22:45 (963 MB/s) - ‘jdk-10.0.1_linux-x64_bin.tar.gz’ saved [5307/5307]


[root@sankar-devops java]# ls -l

-rw-r--r-- 1 skodipilla wheel 354846158 Apr 19 11:22 jdk-10.0.1_linux-x64_bin.tar.gz
[root@sankar-devops java]# 


[root@sankar-devops devops]# tar -xvzf jdk-10.0.1_linux-x64_bin.tar.gz 

.....

[root@sankar-devops devops]# ls -ltrh

total 339M
-rw-r--r-- 1 skodipilla wheel 339M Apr 19 11:22 jdk-10.0.1_linux-x64_bin.tar.gz
drwxr-xr-x 8 root       root   107 Apr 19 11:22 jdk-10.0.1

      

[root@sankar-devops jdk-10.0.1]# update-alternatives --install /usr/bin/java java  /opt/devops/jdk-10.0.1/bin/java 100

[root@sankar-devops jdk-10.0.1]# echo $?

0
[root@sankar-devops jdk-10.0.1]# update-alternatives --config java

There are 3 programs which provide 'java'.


  Selection    Command

-----------------------------------------------
*+ 1           /usr/java/jre1.8.0_121/bin/java
   2           /opt/jdk1.8.0_121/bin/java
   3           /opt/devops/jdk-10.0.1/bin/java

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


[root@sankar-devops jdk-10.0.1]# java -version

java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
[root@sankar-devops jdk-10.0.1]# 

2 comments: