There are two ways to fix this:
1) Change the PATH (as someone has already mentioned)
The important thing with this solution is to set JAVA_HOME before the windows paths. This is because under the windows folder, there is a java.exe that redirects to the last installed jre.
2)
Regedit. The key HKEY_LOCAL_MACHINE->SOFTWARE->JAVASOFT->Java Runtime Environment contains the last installed version that the java.exe in the windows folder redirects to. If you change this to a previously installed version, everything should be peachy. (At least, I think this is the right registry key)
pathenvironment variable. You can examine it in command line with:echo %PATH%. These are default folders where binaries are looked for. If you find a path to JAVA you could adjust it easily in System Preferences. – Rekin Mar 24 '11 at 15:08