There is windows process which is actually a java application (java.exe). I need to close it from within other java application (other running .jar) which is probably will also be named as java.exe
in windows taskbar.
To do the task we would normally do it this way
Runtime.getRuntime().exec(KILL + serviceName); // where serviceName is a `java.exe`
But there would be some java.exe
processes in windows taskbar. So how to find the one I need? In this case it is forum.jar
.
Actually this jar was started from .bat file (if it makes any difference) - it is process.bat
as it seen in the screenshot.