Original link: https://www.cnblogs.com/cnmenglang/p/6270375.html
1.echo $JAVA_HOME
If you use $JAVA_HOME to locate the JDK installation path, the premise is that the environment variable $JAVA_HOME is configured. Otherwise, as shown below, the JDK installation path cannot be located at all
[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 ~]# echo $JAVA_HOME
2. which java
First of all, we must declare which java cannot locate the installation path. Which java locates is the execution path of the java program. The information on the Internet is all about others, and I don't think about it at all. So how to locate the java installation path? Let's take a look at an example, as shown below:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|