views:

154

answers:

3

I've recently released a cross platform Java application. For distribution we created a NSIS installer for Windows and used a DMG for Mac (that has JarBundled .app file). We also plan on creating Linux RPMs, DEBs and tarballs.

In total that's 5 different distribution methods to look after.

My question is: What is the best cross-platform way to patch a Java program that runs on many platforms?

+4  A: 

I would say that an Ant script is a reasonably cross-platform way to perform a task. If your patch logic includes moving some files around, updating jars, handling configuration etc., then Ant might suit you. You can use AntInstaller as a GUI.

Eli Acherkan
I think you misunderstood. I'm looking for a way to send patches to users. Users who use this app will be highly non-technical, so the most we can expect from them is to be able to double-click an EXE or DMG file. Edit: NM, it looks like you understand :)
cdmckay
Come to think of it, releasing a patch is pretty much like releasing a full installation package. Regarding a nice installation wrapper for end-users, in my project all the installation/patch logic is an Ant script, and we're using AntInstaller plus a platform-specific startup script (.bat/.sh) to bootstrap AntInstaller. This might not be the best solution (.exe would be nicer), but - just my 2 cents.
Eli Acherkan
I'd appreciate a comment about the downvote.
Eli Acherkan
+4  A: 

This might not be an option for you, but I think the best way is to use Java Web Start.

It provides platform-independent mechanisms to automatically download patched versions of your software.

Peter Lang
I am confused by this answer, how would jws aid in applying a patch? Could you elaborate?
kgrad
@Peter Lang: I'm working for a company selling commercial software. The last thing you want, unless you're willing to sacrifice a huge part of your potential OS X customers, is to use Java Web Start. For a start, Java still has a *very* bad rep amongst OS X users and you're rather hide them the fact that it's a Java app. Then of course JWS a huge load of problem of its own.
Webinator
@WizardOfOdds, Java works fine here for us under OS X. Could you elaborate on your experience with Java under OS X since it is so bad? A distribution can contain initial seeding for a JNLP application so the big download can be avoided.
Thorbjørn Ravn Andersen
@kgrad, Java Web Start allows for providing new jars to an existing applicatin by updating the JNLP-file on the server.
Thorbjørn Ravn Andersen
+4  A: 

Have you considered simply releasing new minor versions of the entire app, instead of patches? Since you will already have invested time into the installers for the various platforms, it seems like it would avoid a lot of hassle trying to come up with a second method for each platform. I can't think of a drawback unless your application is extremely large, as bandwidth is pretty cheap nowadays.

Pete
The main reason for us wanting to avoid that is that we don't want to distribute the installer to everyone, as the only thing protecting us from piracy is a simple license key validator. A patcher, on the other hand, can be distributed from our website easily, as it's useless without the main program.
cdmckay
I agree - just build new version of the installers, so the user doesn't deal with different installation methods.
Karsten Silz
How do you distribute your original app?
Karsten Silz
But the person applying the patch must have the original installed app, so just secure your website so they have to log in using their product serial number, etc, to access the patch download area.
Pete
@Pete: That's a good idea, I think we might just go with that.
cdmckay