Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Command Prompt on Windows 7 to JDK7 after installed the JDK8

Tags:

java

jvm

java-8

Once I installed JDK 8, I am not succeeding to set the Command Prompt to the JDK 7 again, on Windows 7.

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

In Java Environment Settings I also have the JDK 7 enabled.

java-runtime-env-settings

How can I configure my command prompt for the JDK 7 again?

like image 928
Miguel Gamboa Avatar asked May 05 '14 10:05

Miguel Gamboa


1 Answers

An answer based on the comments.

java.exe is installed into the %SystemRoot%\system32 directory and this java runs the version of Java based on your registry. If you want to override this version of Java, you need to ensure not only that it is in your PATH, but it must appear before your %SystemRoot%\system32 otherwise only additional commands like javac or jar use the version you expect. (As these are not in System32 )

like image 174
Peter Lawrey Avatar answered Oct 25 '22 10:10

Peter Lawrey