12

I have a Java webstart application that requires Java 7+, so the JNLP has this line:

<j2se version="1.7+" href="http://java.sun.com/products/autodl/j2se"/>

This works on various Windows XP & Windows 7 machines (most of them also having Java 6 installed) but on one of them, webstart is launched with Java 6 and fails (wrong version of JRE). I found this post and checked the Java settings and they look fine:

enter image description here

I have also tried changing the JNLP line to this but it still does not work:

<j2se version="1.7+"/>

Any ideas on how to let webstart know that the JRE 1.7 is there?

Config: Windows 7, run as administrator - webstart application launched from IE.

Community
  • 1
  • 1
assylias
  • 321,522
  • 82
  • 660
  • 783
  • I don't know much about this but, are you sure it's not something to do with a setting in IE somewhere? I know IE can be a pain in the butt . – Perry Monschau Mar 21 '12 at 10:26
  • @PerryMonschau I have no idea - I checked the Internet Options but could not find anything that seemed related. It is not a security issue because the application **is** launched (but with wrong JRE)... – assylias Mar 21 '12 at 10:27
  • Ok, try following the steps in the first or second answer here: http://stackoverflow.com/questions/71254/force-internet-explorer-to-use-a-specific-java-runtime-environment-install Except replace his 1.5 with 1.7 – Perry Monschau Mar 21 '12 at 10:33
  • Be sure to validate the JNLP using [JaNeLA](http://pscode.org/janela/) as a first step. Many JNLP files are horridly broken, and it is not predictable how the JWS client will interpret them. Then if it still fails, try it with 1.6 unselected (which should not be necessary, but I am curious as to whether it will work). Then check the bug DB and if you find nothing similar, start a new one & see what Oracle has to say on the matter. – Andrew Thompson Mar 21 '12 at 10:42
  • @AndrewThompson Actually even with 1.6 unchecked, it still runs with 1.6... weird... – assylias Mar 21 '12 at 10:53
  • @AndrewThompson JaNeLa worked fine. I found the issue - posting the answer now (I feel a little stupid). – assylias Mar 21 '12 at 11:04
  • @AndrewThompson By the way, I just realised you developed JaNeLa - I get a NPE for one of my JNLP. Let me know if you want to see the file. – assylias Apr 11 '12 at 15:55
  • *"I get a NPE for one of my JNLP."* I don't quite get it. Do you mean that JaNeLA is reporting that error to you about the JNLP, or that your console/log/command line is reporting that JaNeLA itself threw an NPE? – Andrew Thompson Apr 11 '12 at 15:58
  • When opening the JNLP in JaNeLa, I get a dialog titled "Problem with URL" and the text is "java.lang.NullPointerException". – assylias Apr 11 '12 at 16:00

2 Answers2

12

I found the problem. I had Java 6 32bits & 64bits installed, but Java 7 only had the 64bits version installed. And I was launching the webstart link from Internet Explorer 32 bits, which I suppose cannot use a 64 bits version of JRE.

Launching the webstart from IE 64 bits worked fine.

Thanks for your comments, I figured the problem out while doing one of the manipulations you recommended.

assylias
  • 321,522
  • 82
  • 660
  • 783
2

I had a similar problem with Java 6 being used to launch JNLPs rather than Java 7 (I have both installed), even though my JAVA_HOME, PATH and Java Control Panel settings were all set to 7. Java 7 would be used when launching from a web page, but from a desktop shortcut, Java 6 was being used and so be unable to launch the app since it requires 7.

Turns out that there are java, javaw and javaws executables present in C:\Windows\SysWOW64 and this is what the generated shortcut points to. So I overwrote those EXEs with the ones from C:\Program Files\Java\jre7\bin.

Perhaps a reinstallation of JRE 7 would also have fixed this but I just went for this quick fix.

Matthew Wise
  • 2,639
  • 26
  • 23
  • 1
    +1 for a good result. I've tried both of the solutions on this page and am still struggling with the issue on Windows 10 for one of my users. – Matthew McPeak Oct 27 '17 at 20:14