Installing jar file via nssm

1.8k views Asked by At

I'm struggling to get this to work using nssm (Non-sucking Service Manager).

I'm trying to get a jar file (Spring-Boot application) to run. With out arguments, I got the service to install and run fine, but I need to pass in VM arguments and I'm banging my head trying to get it to work using nssm.

So the command I need to feed into nssm to make a windows service is: $> java "-Dspring.profiles.active=dev" -jar .\neo-0.0.1-SNAPSHOT.jar

Any help would be greatly appreicated.

1

There are 1 answers

0
Gerb On

I was able to get it running; instead of passing in a system property (VM property) I pass in the value via application argument.

nssm install JarServiceWithArgs FullJavaPath\java.exe -jar app.jar --spring.profiles.active=dev