3

I have a desktop application and I want to launch that application using JAVA Web start. It is working fine when I am launch it first time using a browser and it will download all jars defined in resources. Next time I run it using JNLP or from browser, it will not download any jars. The jars that are used come from cache or some where else, I don't know...

I want that every time when my application is launched all jars defined in resources are downloaded

my jnlp file contains :

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="">
    <information>
        <title>example</title>
        <vendor>example</vendor>
    </information>
    <resources>
        <!-- Application Resources -->
        <j2se version="1.5+"
              href="http://java.sun.com/products/autodl/j2se"/>
        <jar href="application.jar" main="true" />
        <jar href="lib/app.jar" />             
    </resources>
    <application-desc main-class="com.application.entry">
  </application-desc>
   <update check="background"/>
   <security>
     <all-permissions/>
   </security>
</jnlp>
boutta
  • 24,189
  • 7
  • 34
  • 49
user1068768
  • 43
  • 1
  • 6
  • Check out the answers to this similar question: http://stackoverflow.com/questions/2148454/java-webstart-intermittant-jar-not-updating – holygeek Dec 05 '11 at 07:55
  • That JNLP file is invalid. For best results, validate it using [JaNeLA](http://pscode.org/janela/). – Andrew Thompson Dec 05 '11 at 09:30

4 Answers4

5

It will download jars if there are new versions of them. If not, there is really no need to download files.

Romczyk
  • 361
  • 3
  • 12
  • How would it know that,new versions are available.. can you explain please... I have upload my jar at server.after make some changes reupload it. but still it will not download jars.i.e it is using old jars. – user1068768 Dec 05 '11 at 09:05
  • 1
    JWS will check the 'last updated' time on the server against the locally cached versions, if it is later, the new Jars will be downloaded. Note that due to time-zone differences between server and client, this might result in a delay of up to 24 hours between when a new Jar is uploaded, and when it is recognized as new content to be updated. – Andrew Thompson Dec 05 '11 at 09:29
  • @AndrewThompson: Sounds reasonable. But I'm having trouble finding an authoritative source. Is this in the standards somewhere? – StackzOfZtuff Feb 13 '19 at 13:11
  • @StackzOfZtuff It has become irrelevant. See [Java Plugin support deprecated](http://www.gizmodo.com.au/2016/01/rest-in-hell-java-plug-in/) and [Moving to a Plugin-Free Web](https://blogs.oracle.com/java-platform-group/moving-to-a-plugin-free-web). (Note that the 'plug-in' is required for both applets **and JWS**.) – Andrew Thompson Feb 14 '19 at 00:02
1

Three different check configs we can be set:

  • update check="timeout" policy="always"
    Default
  • update check="always" policy="always"
    Always download the resources irrespective of any change in resource eg: jar file
  • update check="background " policy="always"
    Will enable the current client already downloaded in cache to open and if there is any change in resources it will start downloading in background.Next time when the application is opened it will start with the new version.

`

StackzOfZtuff
  • 2,534
  • 1
  • 28
  • 25
1

Although the behavior pointed by Andrew Thompson is something you can expect, you can change the update policy like this:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="">
    <information>
        <title>example</title>
        <vendor>example</vendor>
    </information>
    <resources>
        <!-- Application Resources -->
        <j2se version="1.5+"
              href="http://java.sun.com/products/autodl/j2se"/>
        <jar href="application.jar" main="true" />
        <jar href="lib/app.jar" />             
    </resources>
    <application-desc main-class="com.application.entry">
  </application-desc>
   <update check="always" policy="always"/>
   <security>
     <all-permissions/>
   </security>
</jnlp>
Community
  • 1
  • 1
user935581
  • 17
  • 5
0

Yes, it is the point for solving the problem.

The solution is easy, you have make these changes :

update check="always" policy="always

And it must not be into anything set

blo0p3r
  • 6,790
  • 8
  • 49
  • 68
Abel
  • 1