I\'m in the situation where I\'ve installed the JDK, but I can\'t run applets in browsers (I may not have installed the JRE).
However, when I install the JRE, it clo
After many attempts, I found the junction approach more convenient. This is very similar on how this problem is solved in linux.
Basically it consists of having a link between c:\tools\java\default and the actual version of java you want to use as default in your system.
PATH pointing to ONLY to this jre c:\tools\java\default\bin
- JAVA_HOME pointing to `c:\tools\java\defaultC:\tools\Java\JRE_1.6C:\tools\Java\JRE_1.7C:\tools\Java\JRE_1.8C:\tools\Java\ junction default JRE_1.6This will create a junction (which is more or less like a symbolic link in linux) between C:\tools\java\default and C:\tools\java\JRE_1.6
In this way you will always have your default java in c:\tools\java\default.
If you then need to change your default java to the 1.8 version you just need to execute
junction -d default
junction default JRE_1.8
Then you can have batch files to do that without command prompt like
set_jdk8.bat
set_jdk7.bat
As suggested from @СӏаџԁеМаятіи
mklink /J default JRE_1.8