0

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?

bob.sacamento
  • 6,283
  • 10
  • 56
  • 115

2 Answers2

1

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.)

Joop Eggen
  • 107,315
  • 7
  • 83
  • 138
1

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.

Community
  • 1
  • 1
peter.petrov
  • 38,363
  • 16
  • 94
  • 159