views:

1950

answers:

4

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?

+10  A: 

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.

Ma99uS
AKA "Java Network Launch Protocol (JNLP),
Brian Knoblauch
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.
stolsvik
Why would size be a problem??
Tom Hawtin - tackline
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.
John Gardner
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.
John Gardner
@Tackline: I thought WebStart were mainly for things that initially were started from a web page, and had characteristics of being a rather monolithic, "single" application. What I am talking about is a module-based system, albeit with a core that also need to be updateable.
stolsvik
The problem with JWS is the security manager. It's further stricter than the normal one.
furtelwart
with a dynamic jnlp not sure how multiple application or version is a problem.
l_39217_l
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).
Thorbjørn Ravn Andersen
+1  A: 

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.

davetron5000
jardiff means that only the differences need downloading, not the entire thing. Should be fine even with poor bandwidth.
Tom Hawtin - tackline
@tom, do you have experience with this? I'd like to hear if it is worth the effort.
Thorbjørn Ravn Andersen
+2  A: 

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.

Stephane Grenier
Thanks, that was interesting. Possibly use that for the "core container", and e.g. Eclipse's OSGi for plugins?
stolsvik
+1  A: 

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

Yang