How do I make a Java app self-update?

后端 未结 5 1018
抹茶落季
抹茶落季 2020-12-29 04:18

Problem: I have a standalone Java app (henceforth known as \"the agent\") that runs as a service on internal company servers. It acts as a remote agent for

相关标签:
5条回答
  • Different solution: use (and pay for) install4j. Check out the auto-update features here

    0 讨论(0)
  • 2020-12-29 04:31

    It appears as though Webstart is the only built in way to do this at the moment.

    0 讨论(0)
  • 2020-12-29 04:35

    If your application is OSGi based, you could let OSGi handle bundle updates for you. It is similar to the wrapper approach you suggest, in that the OSGi container itself is "the wrapper" and some of it won't be updated. Here's a discussion on this

    0 讨论(0)
  • 2020-12-29 04:39

    Have a look at Java Web Start.

    It is technology that's been part of Java since... 1.5? maybe 1.4? and allows deployment and install of standalone Java-based apps through a web browswer. It also enables you to always run the latest app.

    http://www.oracle.com/technetwork/java/javase/overview-137531.html

    http://en.wikipedia.org/wiki/JNLP#Java_Network_Launching_Protocol_.28JNLP.29

    also see this question: What's the best way to add a self-update feature to a Java Swing application?

    0 讨论(0)
  • 2020-12-29 04:53

    No need for wrapper (save memory) or java web start (adds more restrictions on your application), simply let a thread in you application check periodically for updates (e.g. from cloud) and download updates if available, then code these two calls in you application:

    1. launch a shell script (.sh or .cmd) to update your artifacts and launch your application after few seconds pause in the script(to avoid having two instances of your application at the same time).
    2. Terminate your application (first instance)

    The script can overwrite needed artifacts and re-launch your application.

    enjoy !

    0 讨论(0)
提交回复
热议问题