When I am working with multiple versions of Java in my windows machine - 1.6 & 1.7, and when I try to switch from 1.7 to 1.6, and modified the PATH environment variable, it's still showing the 1.7 version only. How can I fix it?
Java installations on Windows machines also copy a java.exe
file into the directory C:\Windows\System32
(as well as a javaw.exe
and a javaws.exe
).
As this directory is usually also part of the PATH
environment variable and - also usually - is mentioned before any program directory, you will see the output of the java.exe
file that is from the system directory.
The path usually looks like:
PATH = [...];C:\Windows\System32;[...];C:\Program Files\Java\jdk7\bin;[...]
So even if you switch it to
PATH = [...];C:\Windows\System32;[...];C:\Program Files\Java\jdk6\bin;[...]
you will get a "Version 7" output on the console. If you instead change your path variable to
PATH = C:\Program Files\Java\jdk6\bin;[...];C:\Windows\System32;[...]
then you will get the "Version 6" output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With