Run
where java
at your command prompt.
On my system, it printed something quite unexpected:
C:\Users\Mikel>where java
C:\Windows\System32\java.exe
Verifying there really is a Java there:
C:\Users\Mikel>c:\windows\system32\java.exe -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)
So one solution is to ensure your preferred Java is in the PATH before C:\Windows\System32.
I also tried looking in the Java control panel to see if it manages the version in C:\Windows\System32, but I could only view the settings, not edit them. Maybe it works for you?