Argh! Webstart keeps installing java 5!

Help! I have the JGF auto-JNLP system apparently working, but … for some reason, webstart insists that I “need” java 1.5.0. I have confirmed that webstart is:

  1. fetching the JNLP
  2. checking it…all OK (along the way, I discovered some undocumented requirements of the damn JNLP file. Grr!)
  3. doing a HEAD for each jar resource
  4. doing a GET for each jar resource
  5. …(once all files downloaded)…installing java 1.5.0

No! Bad Webstart! Baaaad!

I originally was using “j2se version=“1.4.2+””, but even switching to “1.4+” I still get the same problem.

Here’s the JNLP file I auto-generated (I thought I’d do the Pang author a favour and make him an auto JNLP since he didn’t have one ;))


<?xml version="1.0" encoding="utf-8"?>
<jnlp
 spec="1.0+"
 codebase="http://localhost:8080/attachments/game/game4/"
 href="http://localhost:8080/jnlp/game4/alpha"
 >
        <information>
                <title>game4</title>
                <vendor>Authors: q, q</vendor>
                <homepage href="/views/view-game?game4" ></homepage>
                <description kind="one-line" >snetence4</description>
                <description kind="short" ><p>
para4
</p></description>
                <icon href="game-logo.jpg" ></icon>
                <offline-allowed></offline-allowed>
        </information>
        <security>
                <all-permissions></all-permissions>
        </security>
        <resources>
                <jar href="alpha/Pang4K.jar" ></jar>
                <j2se version="1.4+" ></j2se>
        </resources>
<application-desc></application-desc>
</jnlp>

Take the “+” off the end of the version number?

Kev

/me would like to pay a visit to the sun offices and slap a few people.

Either:

  1. Contrary to the documentation, and to common sense:
    1.4.2+ == 1.5+
    even though, as expected (!):
    1.4+ == 1.4+

or:

  1. <j2se …> != <j2se …/>

…since those are the only things I’d changed.

As for the “1.4+ makes no difference”, well…webstart was caching and not refetching the JNLP because the local server date was wrong (returning a last changed timestamp that wasn’t changing) so I was always seeing the original version :(. Doh!

[quote]Take the “+” off the end of the version number?

Kev
[/quote]
I can’t find the quote in the jws docs right now, but XX+ is defined as “XX or later, checking all possible XX’s first, and ONLY attempting to download a later version if no matching XX is found on the local machine”.

However, more to the point, your tilt4k JNLP specifies 1.4+ and works as expected (doesn’t download 1.5 since 1.4.2 is already installed).

Um. Sadly, I’m going to have to track this down cos otherwise it could screw up all the JNLP’s on JGF :(. Sigh. More wait before the thing’s live :(.

OK, was easier than I thought. Stealing kev’s line from tilt4k and copy/pasting it in I worked it out:

Contrary to the docs, there has to be an HREF in there, or else webstart executes the wrong code path, at least for java 1.4.2_05. Maybe they’ve fixed this for java 1.5.0, but, um, it’s gonna be hard to tell until they release java 6 :).

Supposedly (accoridng to docs) the href is ONLY needed if you specify the _01 or the -beta2 part.


Exact product versions (implementation versions) may also be specified&#8212;e.g., 1.3.1_01 or 1.4.2-beta by Sun Microsystems, Inc.&#8212;by including the href attribute. E.g.,

Er…or I’m just stupid and can’t understand docs :(.