title: Java Web Start Application works with Java 6, but only if Java 7 is completely uninstalled. (Win7)
body: <p>We are using a web-based KVM switch which opens up a Java Web Start launcher in order to boot the console.  When I run it with Java 6, update 43,  everything works great.  Then, I install Java 7 update 17 alongside it, and it gets a socket connection error.  I took the liberty of writing a simple batch script which forcibly chooses the Java home as well as the web start application. I then saved the jnlp file which is downloaded so that I could call it on a whim.  I am by no means a Java developer, so I apologize for any offensive practices. </p>
  
  <pre class="lang-bat prettyprint-override"><code>set JAVA_HOME="C:\Program Files (x86)\Java\jre6"
  %JAVA_HOME%\bin\javaws.exe   "C:\opt\kvm\ui.jnlp"
  </code></pre>
  
  <p>Here is the connection exception that I receive.</p>
  
  <pre><code>java.io.IOException: JNLP Jar download failure.
  at com.sun.javaws.LaunchDownload.validateResults(Unknown Source)
  at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source)
  at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source)
  at com.sun.javaws.Launcher.downloadResources(Unknown Source)
  at com.sun.javaws.Launcher.prepareResources(Unknown Source)
  at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
  at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
  at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
  at com.sun.javaws.Launcher.launch(Unknown Source)
  at com.sun.javaws.Main.launchApp(Unknown Source)
  at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
  at com.sun.javaws.Main$1.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source)'
  </code></pre>
  
  <p>I was wondering if you know of any reasons why Java would have different behavior when multiple versions of Java are installed?  The best explaination that I can come up with is that there is a library collision.  If this is the case, then I need to find a way to manually set the library path such that only Jre6 dlls/tools will be called.  If anyone has any advice, I  would be extremely grateful. I have also attached the internal jnlp data.  Thank you very much for your time. </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!-- JNLP File IRP EMS     --&gt;
  &lt;jnlp
    spec="6.0+"
    codebase="https://&lt;IP-Address&gt;"&gt;
    &lt;information&gt;
      &lt;title&gt;TrippLite UI&lt;/title&gt;
      &lt;vendor&gt;TrippLite&lt;/vendor&gt;
      &lt;homepage href="http://www.tripplite.com"/&gt;
      &lt;description kind="short"&gt;TrippLite Manager&lt;/description&gt;
      &lt;icon href="minicom_desktop.gif"/&gt; 
    &lt;/information&gt;
  
    &lt;security&gt;
        &lt;all-permissions/&gt;
    &lt;/security&gt;
    &lt;resources&gt;
      &lt;j2se version="1.6+" initial-heap-size="256m" java-vm-args="-Xnoclassgc -    XX:PermSize=64m" 
          href="http://java.sun.com/products/autodl/j2se"/&gt; 
          &lt;jar href="./boot.jar"/&gt;
      &lt;jar href="./app.jar"/&gt;
      &lt;jar href="./vendor.jar"/&gt;
      &lt;jar href="./miglayout15-swing.jar"/&gt;
      &lt;jar href="./jnlp.jar"/&gt;
  &lt;jar href="./xstream-1.3.1.jar"/&gt;
  &lt;jar href="./xpp3_min-1.1.4c.jar"/&gt;
  &lt;nativelib href="./plugin.jar"/&gt;
  
      &lt;property name="devport" value="900"/&gt;       
    &lt;/resources&gt;
    &lt;application-desc main-class="com.minicom.app.video.ui.ShowLogin"&gt;
    &lt;/application-desc&gt;
  &lt;/jnlp&gt; 
  </code></pre>
  
  <h2>Update</h2>
  
  <p>I ran the script with -verbose and got the following output. I am new to SO, so I can't post images.  Here is the link. </p>
  
  <p><a href="https://raw.github.com/marvins/temp_images/master/with_setting.png" rel="nofollow">https://raw.github.com/marvins/temp_images/master/with_setting.png</a></p>
  
  <p>It now appears that the problem is because the vm is calling on jre7's javaw.exe file.  Do you know how I could override the "-Djnlpx.jvm=C:\Program Files (x86)\Java\jre7\bin\javaws.exe and replace it with jre6?  I am trying to use different forms of "-J-Djnlpx.jvm=" and it gives an appearance similar to the one below.  It shows it there, but doesn't replace the value. </p>
  
  <p>Is there a more appropriate way of forcing the proper javaws?</p>
  
  <pre><code>%JAVA_HOME%\bin\javaws.exe  "-J-Djnlpx.jvm=C:\Program Files (x86)\Java\jre6\bin\javaw.exe" -verbose "C:\opt\kvm\ui.jnlp"
  </code></pre>