title: Difference between java.home and JAVA_HOME
body: <p>In my java code, I have this line <code>System.getProperty("java.home")</code>. In some environments, this returns the same value as what has been set <code>JAVA_HOME</code> as environment variable.</p>
  
  <p>But in some environments, <code>System.getProperty("java.home")</code> returns completely different value from <code>JAVA_HOME</code>.</p>
  
  <p>So my question is what's the difference between <code>java.home</code> and <code>JAVA_HOME</code> from java perspective? </p>
  
  <p>What i know from my research is <code>JAVA_HOME</code> is jdk installation path, <code>java.home</code> is jre installation path, but then why can't it match as jre can be part of jdk installation.</p>