Install the command prompt in Windows 7 on JDK7 after installing JDK8

Once I installed JDK 8, I will no longer be able to install the command line in JDK 7 on Windows 7.

I already set the system environment properties for JAVA_HOME and PATH to point to JDK7 and my JDK7/bin , and I also restarted SO and every time I open a new command line and run java -version I always get version 8 of Java.

In Java environment settings I also have JDK 7 enabled.

java-runtime-env-settings

How can I configure my command line again for JDK 7?

+6
source share
1 answer

Response based on comments.

java.exe installed in the %SystemRoot%\system32 directory, and this java launches a version of Java based on your registry. If you want to override this version of Java, you need to make sure not only that it is in your PATH , but should appear in front of your %SystemRoot%\system32 otherwise only additional commands, such as javac or jar , will use the version you expect . (Since they are not in System32 )

+8
source

All Articles