Error trying to run .jar executable as a Windows service using NSSM

I have an executable file .jarthat I want to run as a Window service so that it runs even if I log out of the system. I searched and found NSSM. However, after completing the setup, when I started the service, it stopped and typed Unexpected status SERVICE-STOPPED in response to start control. I just added mine pathand startup directoryon the tab Application, nothing more. Moreover, I cannot find a log file that I nssmcan create to check what actually happened.

+4
source share
1 answer

NSSM logs messages in the Windows system event log. To open the event viewer, simply enter the "event viewer" in the Windows Start menu. In the Event Viewer, select "Event Viewer" ("Local") → "Windows Logs" - "Application → nssm" or "Event Viewer" ("Local") → "Custom Views" → "Errors and Warnings".

Also, make sure that you configure the log files for stdout and stderr when you install your service using NSSM.

The NSSM properties for installing the jar executable should look something like this:

: C:\Program Files (x86)\Java\jdk1.7.0_45\bin\javaw.exe
: C:\Program Files (x86)\Jars
: -jar C:\Program Files (x86)\Jars\my_executable.jar

+6

All Articles