title: How to programatically get all Java JVM installed (Not default one) using Java?
body: <p>Does anyone know how to programatically get all JVMs installed (not the default one) <strong>using Java</strong>?</p>
  
  <p>For example, there are 2 JVMs installed on a user's machine:</p>
  
  <pre><code>JDK 5
  JDK 6
  </code></pre>
  
  <p>I need to know all the versions installed in order to switch the one that it is on use (by default) and then call javac programatically to compile some source code using a specific JDK version.</p>
  
  <p>I've been looking for some info on the web, I found:</p>
  
  <ul>
  <li><a href="http://www.thatsjava.com/java-core-apis/22263/" rel="noreferrer">How to programatically get a Java version (Not default one) ?</a></li>
  <li><a href="http://forums.oracle.com/forums/thread.jspa?threadID=1518631" rel="noreferrer">How do I programatically get the path to the jdk / javac? </a></li>
  </ul>
  
  <p>But I couldn't find what I was looking for.</p>