...">

JNLP with local code base - how to update?

This field can be specified like this:

<jnlp spec="6.0+" codebase="file:/c:/MyApp/" href="myapp.jnlp"> 

When you import it using JWS, it creates a shortcut on the desktop and the application works.

However, one is very different from the remote code base. When I update these files while the application is running, it basically stops using ClassNotFoundExceptions . It seems that the JWS did not copy the banks or did not copy them immediately, as they are updated, somehow overwriting those used by the running process.

How can I make it work as if the files were deleted? That is, copy files to the cache and check for updates at startup.

EDIT . I did not find a way to do this and decided to go with a homegrown replacement. Along the way, I found some errors and made some comments that I summed up under http://squirrel.pl/blog/2011/11/24/java-web-start-bugs-offline-edition/ . Post it here if this might be helpful to someone.

+7
source share
2 answers

To make your application automatically update, you must use the <update> .

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

And also, if you want, your application can work offline <offline-allowed/> .
You must also add the <security> tag to provide all security permissions.
Add the following tags to your JNLP file.

  <information> <offline-allowed/> </information> <security> <all-permissions/> </security> <update check="always" policy="always"/> <resources> <jar href="your-signed.jar" main="false" download="eager"/> </resources> 
0
source

In our application, the code base is:

 <jnlp codebase="http://xxxx.xxx.xxx/jars"> 

and your jar file should put in your_webapp_root_directory / jars. For testing, you can enter the URL in your browser: http://xxxx.xxx.xxx/jars/xxxx.jar , if you can download the xxxx.jar file, it works.

-4
source

All Articles