17

After the JNLP gets downloaded in the browser it becomes cached so it doesn't need to be downloaded again, which is good. However, as a consequence, if I update the JAR that the JNLP uses, users will still see the old version of the app that is in the cache.

You can clear the cache by running this in the terminal:

javaws -uninstall

But obviously you could not expect from users to run this when your update is ready. It should be more seamless than that.

One idea is to change the jnlp file name so they download new file, like MyJWS-01.jnlp, to include version numbers.

Is there any other way?

Ska
  • 6,658
  • 14
  • 53
  • 74

2 Answers2

7

"The update element is used to indicate the preferences for how application updates should be handled by Java Web Start." The default attribute values would seem to "to check for updates until timeout" and "to always download updates without any prompt." For example,

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

Are you getting a different result?

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • update check="background". I have this in my jnlp and it didn't update, it used the old one. – Ska Jan 12 '12 at 01:12
  • I didn't set the policy, just check="background". Should I put always/always for these two attributes? – Ska Jan 12 '12 at 01:41
  • 1
    The default is ``. You might start with that. Once you know what works, then experiment. – trashgod Jan 12 '12 at 01:47
  • I'm marking this as answered although I haven't tried it yet myself. I guess it has to work and I'll post an update once I try. – Ska Jan 12 '12 at 03:03
  • 2
    I did try it and it works. I'm using check="always" policy="always" – Ska Jan 25 '12 at 00:00
  • and where is the timeout period or frequency defined? Where does the value come from? – reza Apr 16 '13 at 22:11
  • @Michael: These are elements in the [`.jnlp`](https://docs.oracle.com/javase/7/docs/technotes/guides/javaws/developersguide/syntax.html) file. – trashgod Oct 23 '17 at 20:33
  • @trashgod I know it goes in the .jnlp file but wasn't sure if it was in the security tags, information, application, etc. It turns out the update tag is at the same level as those – Michael Oct 23 '17 at 20:44
3

You can also use the jnlp property name="jnlp.versionEnabled" and value="true" where you can enter a specific version number for the jar, and that way a new one will be delivered when you release a new version.

laalto
  • 150,114
  • 66
  • 286
  • 303
pgharron
  • 51
  • 2