In my java code, I have this line System.getProperty(\"java.home\")
. In some environments, this returns the same value as what has been set JAVA_HOME
According to Oracle documentation java.home
is a system property that represents the installation directory of Java Runtime Environment. JAVA_HOME
is an environment variable - not a system property. Please refer to this post to check what is the difference between system property and environment variable.
You can also refer to this post to learn more about JAVA_HOME
.