how to change default java path <p>How can I change default java? Here is my java home directory;</p> <pre><code>JAVA_HOME=C:\Program Files\Java\jdk1.7.0_05; JRE_HOME=C:\Program Files\Java\jdk1.7.0_05\jre; </code></pre> <p>I also added <code>"C:\Program Files\Java\jdk1.7.0_05"</code> directory to path variable.But the problem is when I type <code>java -version</code> from console the output is;</p> <pre><code>Error: could not open 'C:\Program Files\Java\jre7\lib\amd64\jvm.cfg' </code></pre>