How to check the installation path of JDK in Linux

First of all, it is necessary to declare which java cannot locate the installation path. which java locates the execution path of the java program. So how to locate the java installation path? Let's take a look at an example, as follows:

[root@localhost ~]# java -version
 
java version "1.7.0_65"
 
OpenJDK Runtime Environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17)
 
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
 
[root@localhost ~]# which java
 
/usr/bin/java
 
[root@localhost ~]# ls -lrt /usr/bin/java
 
lrwxrwxrwx. 1 root root 22 Aug 17 15:12 /usr/bin/java -> /etc/alternatives/java
 
[root@localhost ~]# ls -lrt /etc/alternatives/java
 
lrwxrwxrwx. 1 root root 46 Aug 17 15:12 /etc/alternatives/java -> /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
 
[root@localhost ~]# 
 
[root@localhost ~]# cd /usr/lib/jvm
 
[root@localhost jvm]# ls
 
java-1.6.0-openjdk-1.6.0.0.x86_64 java-1.7.0-openjdk-1.7.0.65.x86_64 jre jre-1.6.0 jre-1.6.0-openjdk.x86_64 jre-1.7.0 jre-1.7.0-openjdk.x86_64 jre-openjdk
 
[root@localhost jvm]# 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326222753&siteId=291194637