Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing a Java service on Windows 7 with NSSM

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?

like image 978
mcarr Avatar asked Jul 31 '15 18:07

mcarr


1 Answers

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.

like image 79
rkh Avatar answered Oct 12 '22 02:10

rkh