when you are calling a batch file to start the Java process, this will not work:
Q&A: Why doesn’t Srvany Close my Application when I Stop the Service?
Java Process is not getting killed when its Windows service is stopped
Hi,
I have created a Windows Service for a Java based application which is deployed in Tomcat in a Windows 10 machine using below article:
Ref: https://learn.microsoft.com/en-us/troubleshoot/windows-client/deployment/create-user-defined-service
Command I used to create a Windows service is
"C:\Program Files (x86)\Windows Resource Kits\Tools\Instsrv.exe" apache "C:\Program Files (x86)\Windows Resource Kits\Tools\Srvany.exe"
I did required registry configuration changes also for this windows service.
But when I stopped this service then that Java process in Task Manager is not getting killed and even if service is stopped, application keeps running.
Can you please help on this issue that why Java process is not getting killed?
Thanks,
Sarika Singh
2 answers
Sort by: Most helpful
-
EckiS 916 Reputation points
2022-06-17T13:53:33.017+00:00 -
MotoX80 35,051 Reputation points
2022-06-17T14:03:59.867+00:00 Use NSSM instead of srvany.
It will terminate the launched process when you stop the service.