When you develop a service please note the following requirement: The main method will be called when the service is started. The main method must should in a relatively short time (about 20 seconds) to signal successful initialization to the service manager or init system.
To handle the shutdown of the service, you can use the Runtime.addShutdownHook() method to register a thread that will be executed before the JVM is terminated.
For information on how services are installed or uninstalled, please see the help on service options.
Controller class of the
install4j launcher client API
you can register a startup handler to receive the command line parameters.
In this way, you can handle file associations with a single application instance.
This feature is only implemented on Microsoft Windows, on Mac OS X, single bundle media files
always behave this way.