1

Does Java Web Start provide a means to upgrade the JNLP file?

Java Web Start is great, but how does one ensure the JNLP launcher file is upgraded? I would like to avoid the extra step of having the user launch the application from the web page every time.

I am not sure how the Java Web Start short-cut feature works (has not worked for me) so I may be over-looking something. Perhaps a HTTP short-cut to the JNLP file would work though. Unfortunately, that would not allow for the HTML5 offline feature to work.

jcalfee314
  • 4,642
  • 8
  • 43
  • 75
  • This [link][1] from stackoverflow, you should use the update element. [1]: http://stackoverflow.com/questions/8828643/java-web-start-how-to-clear-cache-or-update-the-app-from-users-perspective – Caio Oliveira Nov 25 '13 at 17:05
  • But how would the user launch the app in a way where the JNLP file would be updated? – jcalfee314 Nov 25 '13 at 17:17

2 Answers2

0

The update works as follows.

The JWS compares the version of JNLP it down with that stated in the codebase.

If you have something different it downloads the new version automatically.

Try this:

<update check="timeout" policy="prompt-update"/>
Emmanuel Bourg
  • 9,601
  • 3
  • 48
  • 76
0

For the JNLP file to be updated it must contain a href attribute on the <jnlp> element, otherwise Java Web Start doesn't know where it comes from and is unable to update it:

<jnlp spec="1.0+" codebase="http://example.com/" href="http://example.com/myapp.jnlp">

You can then force Java Web Start to check if it's updated by adding:

<update check="always" policy="always"/>

If the href attribute is missing Java Web Start will only check the jar files, so if you add or rename a jar the application will be broken and users will have to launch the application from the web page.

Emmanuel Bourg
  • 9,601
  • 3
  • 48
  • 76