I am looking for the best way to make my desktop java program run in the background (daemon/service?) across most platforms (Windows, Mac OS, Linux [Ubuntu in particular]).
By ‘best way’ I am hoping to find a way that will:
- require a minimum amount of platform-specific code.
- not require the user to do anything a general computer user couldn’t/wouldn’t do
- not be a resource hog.
I understand that my requirements may be unrealistic but I am hoping there is some sort of ‘best practice’ for this type of situation.
How to go forward?
You can use the SystemTray classes and install your app as any other in the default platform.
For windows it could be an scheduled task that run at startup. For Linux and OSX I don’t know (besides crontab wich is somehow too technical) but I’m pretty sure they both have a way to do the same thing easily.
Unfortunately (as of today) Apple hasn’t finished the 1.6 port.
It won’t be a real demon, but an app like Google Desktop.
I’ve heard Quartz is a good option. But I’ve never used it.