28

What system do you recommend for implementing "automatic updates" for some java (desktop) application? I'd also want to have module/plugin installation and update. Think Eclipse and Firefox.

I'm aware of Eclipse RCP's OSGi stuff, and also NetBeans RCP has something here. Do one have to buy wholly into their respective RCP stuff to use their module and automatic update systems?

Are there other options?

5 Answers 5

18

Have you looked at the Java Web Start? It checks for updated module on the server and downloads it only if required otherwise things are cached locally on the client PC and starts from there.

Sign up to request clarification or add additional context in comments.

9 Comments

I don't quite feel that Java Web Start is the answer here. Assume this is a largish application - close to an application "container" like Eclipse (the IDE) is, and like Firefox is.
Webstart is ok, but has lots of wierd issues. especially if you're installing multiple versions or the same version multiple times (which is not uncommon for developers/QA), and lots of things were you have to go to the cache viewer, etc.
Also, if you use webstart, the user can always turn on the java console, so be careful with whatever you're sending to System.out/err streams.
The problem with JWS is the security manager. It's further stricter than the normal one.
Be aware that Java Web Start traditionally has had a lot of caching problems. You can help a lot by ensuring that each version of each file you deploy has a unique URL (e.g. by embedding the version name or release number in the URL).
|
9

I believe install4J now offers this functionality as part of their install builder (http://www.ej-technologies.com/products/install4j/overview.html) We've been wanting to check it out but haven't had a chance yet.

1 Comment

Thanks, that was interesting. Possibly use that for the "core container", and e.g. Eclipse's OSGi for plugins?
8

Web Start is great if you have infrequent updates and good bandwidth.

If not, however, you need something else. I worked on a project where we had frequent updates and horrible bandwidth. We rolled our own classfile server; the startup code would talk to the server to see if updates were needed on a per-class basis. If so, the changed classes were downloaded and the application continued as normal.

It was actually not terribly complicated, so don't be afraid to roll your own if existing tools don't work.

4 Comments

jardiff means that only the differences need downloading, not the entire thing. Should be fine even with poor bandwidth.
@tom, do you have experience with this? I'd like to hear if it is worth the effort.
davetron, how can I implement the startup code within one jar file? The class diff scanning is no problem, but the startup is. I can't overwrite the running jar after downloading the update.
Tomáš: what we did (and I'm hazy as this was almost 7 years ago :) was to download the classes, and make sure the new ones were on the class path before the older ones. We had control over the classpath, so this was not a problem.
1

Take a look at Equinox p2, which is probably what you meant by "Eclipse RCP's OSGi stuff"... AFAIK you will need to OSGi-ify your app to use p2 (which at the very least means making your whole application one big bundle).

Comments

0

It is not like plugin system. But it has updating and installing function for desktop app. You can look by link this

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.