How do I find the JDK installation path on a Linux server? Are there ways to find the installation path for locating the JDK? Are there some limitations? Here's a summary of how to find the JDK installation path.
1:echo $JAVA _home
If you use $java_home, you can locate the installation path of the JDK as long as the environment variable $java_home is configured, otherwise the installation path of the JDK is not located at all.
[Email protected] ~]# java-"1.7.0_65"OpenJDK Runtime Environment (Rhel-2.5.1.2.el6_5-x86_64 u65- 64-bit Server VM (build 24.65-~
2:which Java
First of all, make a statement that which Java is not located in the installation path. Which Java navigates to the execution path of the Java program. The information on the Internet is the same, not to think at all. So how do you navigate to the Java installation path? Let's take a look at the example below, as shown below:
[Email protected] ~]# Java-Versionjava version"1.7.0_65"OpenJDK Runtime Environment (Rhel-2.5.1.2.el6_5-x86_64 u65-B17) OpenJDK64-bit Server VM (Build 24.65-b04, Mixed mode) [[Email protected]~]# which Java/usr/bin/Java[[email protected]~]# ls-lrt/usr/bin/javalrwxrwxrwx.1 root root 15:12/usr/bin/java-/etc/alternatives/Java[[email protected]~]# ls-lrt/etc/alternatives/javalrwxrwxrwx.1 root root 15:12/etc/alternatives/java/USR/LIB/JVM/jre-1.7.0-openjdk.x86_64/bin/Java[[email protected]~]# [[email protected]~]# CD/usr/lib/ JVM[[email protected] jvm]# Lsjava-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[[email protected] jvm]#
Reference:
Http://www.cnblogs.com/kerrycode/archive/2015/08/27/4762921.html
How Linux looks at the JDK installation path