Installing a Java service on Windows 7 with NSSM

mcarr picture mcarr · Jul 31, 2015 · Viewed 14.6k times · Source

I am trying to use Inno Setup to install a Windows service as a JAR file running under NSSM (Non-Sucking Service Manager)

nssm install JarService java -jar service.jar
nssm start JarService

ends up putting my service in the "Paused" state, and it doesn't ever seem to get started.

Since the location of java.exe can change with updates, I want to be able to run the service without having the explicit path to java.exe, how can I launch the java service without an explicit path in NSSM?

Answer

rkh picture rkh · Jul 31, 2015

I had to do something quite similar just last week. When I replace "java" with the full path to java.exe, I can get a service to run, so:

nssm install JarService FullPath/java.exe -jar service.jar

should work. I don't think NSSM searches the path for its application.