Java Web Start - How to clear cache (or update the app from user's perspective)

北城以北 提交于 2019-12-20 17:40:29

问题


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?


回答1:


"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?




回答2:


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.



来源:https://stackoverflow.com/questions/8828643/java-web-start-how-to-clear-cache-or-update-the-app-from-users-perspective

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!