title: How to set different java versions for different apps. on a windows PC?
body: <p>I have 2 different apps, one of them is a <code>java desktop app</code> and the other one is a <code>c# web app</code>. which uses <code>java applet</code> in order to e-sign. The problem is <code>desktop java app requires 1.5.0_14 and on the other hand web app. requires 1.7</code> and higher version of java.</p>
  <p>I installed both <code>java 1.5</code> and <code>1.7</code> versions on my PC. In order to run desktop java app., I go to <code>C:\Progra~2\Java\jre1.5.0_14\bin</code> and run <code>javacpl</code> to <strong>disable 1.7 and enable 1.5</strong>. Then I make a shortcut to <code>javaws 1.5.0_14</code> to my desktop and add the jnlp of this java app (<code>http://abc/appclient/tt.jnlp</code>) to the target of javaws shortcut. After those settings, the java desktop app. runs.</p>
  <p>Now I needed to also run the web app which requires <strong>1.7 java.</strong> In order to run this app. properly <strong>Java 1.5 should be disabled, 1.7 enabled on the Java Control Panel settings</strong>. <strong>Problem is when you run this web app. the settings for 1.5.0_14 break down,</strong> I mean <strong>all of the java versions become enabled in javacpl under <code>C:\Progra~2\Java\jre1.5.0_14\bin directory</code></strong>. If I restart my PC, I need to reset the java versions. <strong>Is there a way to make this happen without pain in the head</strong>?</p>
  <p>I would be so glad if you can help me.</p>
  <p>By the way, <strong>I tried to use batch files, etc. but did not succeed</strong>. Is there a permanent solution?</p>
  <p><strong>UPDATED:</strong>
  Here is how I did it back then.</p>
  <p>Here is what I do to solve my issue;</p>
  <pre><code>    Uninstall the older Java -if there is- (in my case it is 1.5.0_14 )
      install java equal/higher than 1.7 just to run e-sign on my web application
  
      I prepared a VBScript in order to just run the desired jre version as follows and put jre1.5.0_14, jnlp file and VBScript on the same folder and make shortcut to the VBScript to run.
  
      Set oShell = WScript.CreateObject(&quot;WSCript.shell&quot;) oShell.run &quot;%comspec% /c D:\TMS\jre1.5.0_14\bin\javaws.exe D:\TMS\tt.jnlp -verbose&quot;, 1, True
  
  Set oShell = Nothing
  </code></pre>
  <p>Best Regards.</p>
  <p>Thanks in advance.</p>