title: Problems with System.getProperty("java.home")
body: <p>I run Windows 7 with different JRE/JDKs installed. I try to set the JAVA_HOME path to "C:\Program Files\Java\jdk1.8.0_45". I tried multiple ways to do that like described in <a href="https://stackoverflow.com/questions/2619584/how-to-set-java-home-on-windows-7">How to set java_home on Windows 7?</a>.</p>
  
  <p>I think it worked, because in the advanced System Properties, the new path is shown and the command echo %JAVA_HOME% also returns the new path. But when I invoke the following program via cmd</p>
  
  <pre><code>public class JavaVersionShower {
      public static void main(String[] args){
          JOptionPane.showMessageDialog(null, System.getProperty("java.home"));
      }
  }
  </code></pre>
  
  <p>the message window says "C:\Program Files\Java\jre1.8.0_66".
  I also cannot use the JavaCompiler API which is only available if the used java version is a jdk.</p>