Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ensure latest versions of JARs are used with a JNLP application?

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>
like image 369
user1068768 Avatar asked Nov 18 '25 05:11

user1068768


2 Answers

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

like image 68
Romczyk Avatar answered Nov 19 '25 18:11

Romczyk


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>
like image 32
user935581 Avatar answered Nov 19 '25 18:11

user935581



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!