"Automatic updates" for Java (desktop) application?
Asked Answered
A

5

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?

Arruda answered 20/11, 2008 at 14:35 Comment(0)
U
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.

Uncover answered 20/11, 2008 at 14:42 Comment(9)
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.Arruda
Why would size be a problem??Parish
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.Garrotte
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.Garrotte
@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.Arruda
The problem with JWS is the security manager. It's further stricter than the normal one.Hodeida
with a dynamic jnlp not sure how multiple application or version is a problem.Lionfish
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).Erickaericksen
@JohnGardner User can allways turn on the console.Cholon
A
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.

Ancon answered 20/11, 2008 at 16:49 Comment(1)
Thanks, that was interesting. Possibly use that for the "core container", and e.g. Eclipse's OSGi for plugins?Arruda
M
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.

Mclane answered 20/11, 2008 at 15:49 Comment(4)
jardiff means that only the differences need downloading, not the entire thing. Should be fine even with poor bandwidth.Parish
@tom, do you have experience with this? I'd like to hear if it is worth the effort.Erickaericksen
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.Cholon
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.Mclane
S
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).

Sammiesammons answered 16/12, 2008 at 12:9 Comment(0)
B
0

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

Boarish answered 16/3, 2022 at 12:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.