centos method to find the installed jdk path

  • 2020-06-15 10:57:29
  • OfStack

The lookup procedure with the java command executable is as follows:

Perform which java


[root@localhost ~]# which java
/usr/bin/java

Perform ES9en-ES10en /usr/bin/java


[root@localhost ~]# ls -lrt /usr/bin/java
lrwxrwxrwx. 1 root root 22 10 month  10 08:06 /usr/bin/java -> /etc/alternatives/java

Execute ls-ES18en /etc/alternatives/java


[root@localhost ~]# ls -lrt /etc/alternatives/java
lrwxrwxrwx. 1 root root 73 10 month  10 08:06 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-0.b01.el7_4.x86_64/jre/bin/java

By the known java path for: / usr lib/jvm/java - 1.8.0 comes with - openjdk 1.8.0.144-0. b01. el7_4. x86_64, enter the path for the file is as follows:


[root@localhost ~]# cd /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.144-0.b01.el7_4.x86_64
[root@localhost java-1.8.0-openjdk-1.8.0.144-0.b01.el7_4.x86_64]# ll
 The total amount  4
drwxr-xr-x. 2 root root 4096 10 month  10 14:53 bin
drwxr-xr-x. 3 root root 132 10 month  10 14:53 include
drwxr-xr-x. 4 root root  28 10 month  10 08:03 jre
drwxr-xr-x. 3 root root 144 10 month  10 14:53 lib
drwxr-xr-x. 2 root root 204 10 month  10 14:53 tapset
[root@localhost java-1.8.0-openjdk-1.8.0.144-0.b01.el7_4.x86_64]# 

Related articles: