aymankoo
aymankoo

Reputation: 671

Auto update java application

I am building Java application that will be downloaded for free from the web. I want to add an auto update feature in case of fixing bugs or enhancing the application. For auto update I split my program to 3 units.

  1. Base - very small code that will check for new version of second unit(Uploader) update it and run it
  2. Uploader will check for new update of the project and download any update and run it
  3. Main program- this contains the main application and contains all modules.

I did above for 2 reasons:

  1. I don't want the client to restart the application in case of any update
  2. As the application still new I don't want to have any problem where user will not be able to run or update the application, so the Base is very small and it hardly has errors.

Is there a common Java method/third party to do the auto update?

Upvotes: 6

Views: 7323

Answers (3)

queeg
queeg

Reputation: 9372

While Java Webstart is exactly the technology solving the OP's problem, meanwhile Oracle removed Webstart from their Java releases.

Luckily this gap is covered by Open Webstart:

Java Web Start (JWS) was deprecated in Java 9, and starting with Java 11, Oracle removed JWS from their JDK distributions. This means that clients that have the latest version of Java installed can no longer use JWS-based applications. And since public support of Java 8 has ended in Q2/2019, companies no longer get any updates and security fixes for Java Web Start.

This is why we decided to create OpenWebStart, an open source reimplementation of the Java Web Start technology. Our replacement provides the most commonly used features of Java Web Start and the JNLP standard, so that your customers can continue using applications based on Java Web Start and JNLP without any change.

Upvotes: 0

Arthur
Arthur

Reputation: 3473

You can try to use OSGi.

If you will plan properly modular structure of the application, there is a chance that when you update the application modules you do not have to restart the application. You will only need to restart the modules, which will depend on the updated module. Reset dependent modules will take place within the application without restarting the application.

I prefer working with Felix OSGI applications.

Apache Felix

Upvotes: 0

Andrew Thompson
Andrew Thompson

Reputation: 168815

Java Web Start (JWS) is the Oracle Corporation technology used to launch rich client (Swing, AWT, SWT) desktop applications directly from a network or internet link. It offers 'one click' installation for platforms that support Java.

JWS provides many appealing features including, but not limited to, splash screens, desktop integration, file associations, automatic update (including lazy downloads and programmatic control of updates), partitioning of natives & other resource downloads by platform, architecture or Java version, configuration of run-time environment (minimum J2SE version, run-time options, RAM etc.), easy management of common resources using extensions..

Upvotes: 6

Related Questions