Two JVMs and setting the environment variable having issues
I am working on two projects one uses JDK 8 and other uses JDK 6. I installed both the jdks in my machine where JDK8 is set as my default JVM. so I am good with one project settings.
When I am working on second project, I tried to change JAVA_HOME to C:\Program Files\Java\jdk1.6.0_45 and PATH added with C:\Program Files\Java\jdk1.6.0_45\bin and surprisingly I am seeing JDK8 as my default JVM. I checked with java -version or java -fullversion.
Where should I stop the Java process that is initiated with JDK8 ? Where should I start the Java process for JDK6 ? How should I easily switch JVMs when I switch back and forth working on two projects ?
I dont like the idea of uninstalling one jvm when I have to work with another jvm.
Please suggest me. Thanks for your time.
When you run a program in your shell, it is the PATH environment variable which determines which program is run. This is a feature of DOS prompt and unix shells and not specific to Java. If you want to change the program which is run by default, you need to change the PATH.