In my java code, I have this line System.getProperty("java.home"). In some environments, this returns the same value as the value JAVA_HOMEas an environment variable.
But in some environments it System.getProperty("java.home")returns a completely different value from JAVA_HOME.
So my question is, what is the difference between java.homeand JAVA_HOMEin terms of java?
What I know from my research is the JAVA_HOMEinstallation path of jdk, java.homethis is the installation path of jre, but then why can't it match, since jre can be part of the jdk installation.
source
share