title: JDK 7 reports itself as a JRE (via "java.home" system property)
body: <p>I just installed the latest JDK 7 Update 21 and wrote the following one-liner (on Windows 7):</p>
  
  <pre><code>public static void main(String[] args) {
      System.out.println("java.home = " + System.getProperty("java.home"));
  }
  </code></pre>
  
  <p>the output is (surprisingly):</p>
  
  <pre><code>java.home = D:\Java\jdk1.7.0_21\jre
  </code></pre>
  
  <p>I believe I fixed all the common causes:</p>
  
  <ol>
  <li>JAVA_HOME is set to "D:\Java\jdk1.7.0_21"</li>
  <li>I have set "D:\Java\jdk1.7.0_21\bin" as the first path in the system PATH setting.</li>
  <li>There is no java.exe in Windows\System32</li>
  <li>I am using a "fresh" command-line</li>
  <li>I have searched this and other sites extensively</li>
  <li>My registry does not contain a "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment" key. The value of "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.7" contains a correct "JavaHome" value.</li>
  <li>Adding "-server" option to the java.exe call does not change the output</li>
  </ol>
  
  <p>Here is some more output for your information</p>
  
  <pre><code>D:\Temp&gt;echo %PATH%
  d:\Java\jdk1.7.0_21\bin
  
  D:\Temp&gt;echo %JAVA_HOME%
  D:\Java\jdk1.7.0_21
  
  D:\Temp&gt;type SystemInfo.java
  public class SystemInfo {
  
          public static void main(String[] args) {
                  System.out.println("java.home = " + System.getProperty("java.home"));
          }
  
  }
  
  D:\Temp&gt;java -verbose SystemInfo
  [Opened d:\Java\jdk1.7.0_21\jre\lib\rt.jar]
  [Loaded java.lang.Object from d:\Java\jdk1.7.0_21\jre\lib\rt.jar]
  [Loaded java.io.Serializable from d:\Java\jdk1.7.0_21\jre\lib\rt.jar]
  ...
  [Loaded java.lang.Void from d:\Java\jdk1.7.0_21\jre\lib\rt.jar]
  java.home = d:\Java\jdk1.7.0_21\jre
  [Loaded java.lang.Shutdown from d:\Java\jdk1.7.0_21\jre\lib\rt.jar]
  [Loaded java.lang.Shutdown$Lock from d:\Java\jdk1.7.0_21\jre\lib\rt.jar]
  </code></pre>
  
  <p>(Updated:) <strong>Basically I need to know, how to run my java application so that it has access to the java-compiler (found in the JDK's tools.jar) without copying that JAR to some other place.</strong></p>
  
  <p>BTW the main problem behind this is that my jetty can't compile a JSP since the java-compiler is missing. I know I can add "tools.jar" to JRE\lib\ext but thats not a long-term solution.</p>