Passa ai contenuti principali


Visualizzazione dei post con l'etichetta windows

Running Java Applications as a Windows Service with NSSM

Sometimes there is the request to run a Java Application as a windows service, for this scenario it is possible to use a java wrapper as NSSM. The example uses a java application that log on file the boot operation, the alive status every 10 seconds, and the exit operation. The code of the example can be downloaded with SVN from the repository Java package org.gma.tutorial.nssm; import; import; import; import; import java.util.Date; /** * A Simple service to register as Windows Service, the program will log on a * file when it starts, ends and every 10 seconds it will log is alive state * * */ public class WindowsServiceTutorial { public static void main(String[] args) throws FileNotFoundException { /* Set the custom message to display */ String customMessage = "default"; if (args.leng…