I run several web and application servers, which do tend to be developed for a particular JDK. In that case I write a batch file to set the PATH and JAVA_HOME environment variables to a particular version.
Note how I added double quotes around the path - it is needed if there is a space somewhere in the path. Given that most people install the JRE and JDK in C:\Program Files, it's probably needed.
The java.exe and javaw.exe in C:\WINDOWS\system32 are nothing more than wrapper files. They check a part of the registry for the location of the JRE, then execute the java.exe / javaw.exe in that location. When you install a new JRE it changes the registry to say the new JRE should be used, but the old one can still be executed.
By any chance do you know how I can toggle java 1.5 and 1.6 for web start?
My application requires a specific version of the JRE. How do I specify this my JNLP file?
The tag <j2se version="versionNum"> specifies a platform version, where versionNum is 1.2, 1.3, 1.4, or 1.5.
You can request a specific product version by including a vendor URL in the href attribute. For Sun's JREs, the URL is http://java.sun.com/products/autodl/j2se For example, the following J2SE tag will request any Sun 1.3.1 implementation:
<j2se version="1.3.1*" href="http://java.sun.com/products/autodl/j2se"/>
Java Web Start FAQ