Question

Just installed java 1.7 update 51 on a Windows 7 machine. AFAICT, when I compile a source, the system automatically uses the new java. But I try to run it, the system automatically tried to run it with an old java 1.6, and the newly compiled code won't run. How do I convince the machine to use only the 1.7 distribution?

Was it helpful?

Solution

Do you have java.exe in your System32 folder?
I suspect this might be your problem.
See this question I recently asked.

Java Windows7 System32 folder java.exe

I suggest you remove both JDKs, then you install them both without the
option to install a public JRE (be careful about this at installation time).

Also, make sure you understand/control what is in your PATH variable.

I also have both 6 and 7 on my machine, and
since I got rid of the public JREs I am fine.

OTHER TIPS

There is a difference between the JDK (java development kit with javac compiler), and the JRE (java runtime environment). Simply doing an additional JRE 7 installation will do. (This might have been asked during the installation of the JDK.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top