开发者

How do I make an "automatic updater" for my desktop java application? [duplicate]

开发者 https://www.devze.com 2023-02-03 06:15 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: “Automatic updates” of java (desktop) application
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

“Automatic updates” of java (desktop) application

Nowadays it's common for applications to check online if there is a more recent version of the application, and download that.

But how does one create such a solution for a java desktop application?

开发者_如何学GoWhere do I begin? How does it work?


Can you deploy using Java Web Start ?

Using Java Web Start technology, standalone Java software applications can be deployed with a single click over the network. Java Web Start ensures the most current version of the application will be deployed, as well as the correct version of the Java Runtime Environment (JRE).


The way something like this works is generally you have your application split into multiple modules. Each module would be an updatable unit (you probably wouldn't update specific classes within that module) and would be assigned a version number. You would also need to have an updater module that is completely separate from the rest of the application. It needs to be separate because it's going to modify the binaries of the application. When the application starts, the updater will run and check some website for the most recent version numbers of each module. If any version number on the site is greater than the version currently installed, the updater should download and replace the current one with the new one. As @Brian Agnew points out, there are frameworks that will do this for you in Java. I would suggest working with one of those rather than attempting to roll your own.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号