I need to switch from the installed java 7 at 64bit to the installed java 6 on my Windows 7 64bit OS but the usual procedure doesn't works. I tried to change the JAVA_HOME environment variable but when I type java -version, the system replies Java 7... How can I switch from different java versions?
Thank you.
bat and add this file location in your machine's Path environment variable. So now SJV will act as command to "Switch Java Version". Now open new command window and just type SJV 11 it will switch to Java 11. Type SJV 8 it will switch to Java 8.
You need to switch the path environment variable too, to point before to the JRE bin directory. Also, I think modern versions of java place a copy of "java.exe" in the system32 directory of Windows, you'll need to remove them (or rename them, if you want to keep them as backups).
JAVA_HOME
is not used by java.exe.
Make sure to have the path of the Java 6 JRE's bin
directory in the PATH environment variable, before the Java 7 JRE's one, and before windows system directory (system32).
Or you can use the full path of the java command:
c:\java6\bin\java com.foo.bar.Main
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