Auto update java application

空扰寡人 提交于 2020-01-02 03:49:06

问题


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?


回答1:


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..




回答2:


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



来源:https://stackoverflow.com/questions/16028488/auto-update-java-application

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