How to create windows service from java jar?

Rakesh Juyal picture Rakesh Juyal · Oct 24, 2009 · Viewed 118.6k times · Source

I have an executable JAR file. Is it possible to create a Windows service of that JAR? Actually, I just want to run that on startup, but I don't want to place that JAR file in my startup folder, neither in the registry.

Answer

kopernik picture kopernik · Sep 9, 2013

The easiest solution I found for this so far is the Non-Sucking Service Manager

Usage would be

nssm install <servicename> "C:\Program Files\Java\jre7\java.exe" "-jar <path-to-jar-file>"