How to make Java Webstart to use JRE 1.4.2 ?

How can I ensure that a Webstart application uses at least Java 1.42 (with the sun.misc.perf Timer) on the client’s machine?
I’ve read some articles about this topic here in the forum and on SUN’s server, but I can’t figure out.

This doesn’t work…:


..
<resources>
  <j2se version="1.42"/>
  <jar href="Application.jar" main="true"/>
</resources>
..

That’s because there is no such thing as version 1.42. You mean 1.4.2

“1.4.2*” should work

[quote]That’s because there is no such thing as version 1.42. You mean 1.4.2

“1.4.2*” should work
[/quote]
OK many thanks. :slight_smile: I’ll try “1.4.2*” then.
Is it neccessary to specify the download URL? Hope not… (After all, Webstart is from Sun? :wink:

Read the WebStart docs… the download URLs to use are all documented. I think you do need to specify it - but Sun provides the URL to their JRE in the docs.

[quote]Read the WebStart docs… the download URLs to use are all documented. I think you do need to specify it - but Sun provides the URL to their JRE in the docs.
[/quote]
I’ve read the docu before I started this topic.

“1.4.2*” doesn’t work if I don’t specifiy the download URL of the JRE.

With “1.4.2*”, Webstart reports the following error:

Perhaps this page needs updating, but it says the latest VM available for auto dl is 1.4.0:
http://java.sun.com/products/javawebstart/developers.html#auto

[quote]Perhaps this page needs updating, but it says the latest VM available for auto dl is 1.4.0:
http://java.sun.com/products/javawebstart/developers.html#auto
[/quote]
Yes, lost in document space… :frowning: My quoted URL doesn’t say such, I think…
Anyway, your page is helpful, thanks for the URL.

[quote]Perhaps this page needs updating, but it says the latest VM available for auto dl is 1.4.0:
http://java.sun.com/products/javawebstart/developers.html#auto
[/quote]
(wonders if Sun is somewhere making the assumption that you’d only ever request a major version, and if you ask for 1.4.0+ it’ll actually give you 1.4.2 ???)

It is truly catastrophic if 1.4.0 is the latest available - many apps will not run on 1.4.0 nor 1.4.1 because of major bugs (I know of lots in NIO that are complete show stoppers :(, but have also encountered some outside of NIO, IIRC in XML parsing? ).

Er, I may be wrong but didn’t this come up a while ago? I thought the verdict was that webstart only allows you to specify a major version.

Edit: See near the bottom of this thread for some more info on minor numbers: http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=cluebies;action=display;num=1070025482;start=

From the WebStart docs at http://java.sun.com/j2se/1.4.2/docs/guide/jws/developersguide/syntax.html#resources:

[quote]The version attribute refers, by default, to a platform (specification) version of the Java 2 platform. Currently defined platform version are 1.2, 1.3, and 1.4. (A platform version may optionally contain a micro version number; e.g., 1.4.2.)

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

or

[/quote] In fact the example file at the top of that page explicitly uses "1.4.2" as the version string.

[quote]In fact the example file at the top of that page explicitly uses “1.4.2” as the version string.
[/quote]
Agreed, but I remember that discussion and conclusion as well. Is the addition of the minor number a new thing, thus maybe not supported by the client’s version of WebStart?

Three guesses as to why the docs only list 1.3.0 and 1.4.0 as available: (1) to maintain compatibility with older WebStart versions, (2) because the developer “shouldn’t” be targetting a minor version, no matter how valid their reason, or (3) policy changed but no one told the people who make the releases available… ;D

I don’t think that aspect is up to the client - at least not in this context. I assume that the version string is passed verbatim as a parameter to the download URL. So it would be up to the server side to choose the matching JRE to download. I don’t know if it actually works that way, but it seems to be the most logical implementation.

OK. I’ve uploaded a small example Webstart. It says “1.4.2*” as version string plus specifies the auto-download URL (href).
The Jar just uses the sun.misc.Perf timer to output a value. Does it work for you (Win32, Apple, Linux, …) ?
Here’s the jnlp

(In case the freespace server ignores any MIME tpye please try to unpack and start the zipped version of the same jnlp file.)

Runs on Mac OS X 10.3.2 JRE 1.4.2_03

Thanks Swpalmer for testing it. A friend of mine with an Java 1.4.0 on Win32 tested it also and it worked.

So we can conclude the version “1.4.2*” string plus the href URL does do the job.
(Btw. without the href URL, Javawebstart reports an error. Strange enough the error message lists the URL which we have to specifiy in the script…)

So the auto-download part of the jnlp script now reads:


<resources>
  <j2se version="1.4.2*" href="http://java.sun.com/products/autodl/j2se"/>
  <jar href="Yourapplikation.jar" main="true"/>
</resources>