Find the default JDK installation path under Linux [Linux]

First, find renderings

 

 

Second, look for the steps

1, first verify that in accordance with the JDK
the Java -version

[root@iZ2ze3zda3caeyx6pn7c5zZ base-eureka]# java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)

2, and then find the location of the java command

which java

[root@iZ2ze3zda3caeyx6pn7c5zZ base-eureka]# which java
/usr/bin/java

3, find the java command position for the soft address

ls -l /usr/bin/java

[root@iZ2ze3zda3caeyx6pn7c5zZ base-eureka]# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Jun 18 15:45 /usr/bin/java -> /etc/alternatives/java

4. Finally find the JDK installation directory by soft address

ls -l /etc/alternatives/java

[root@iZ2ze3zda3caeyx6pn7c5zZ base-eureka]# ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 73 Jun 18 15:45 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre/bin/java

 

Guess you like

Origin www.cnblogs.com/756623607-zhang/p/11442320.html