Difference between java.home and JAVA_HOME

前端 未结 2 1104
渐次进展
渐次进展 2020-12-10 03:58

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

2条回答
  •  时光取名叫无心
    2020-12-10 04:30

    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.

提交回复
热议问题