I am trying to emulate the functionality of a currently existing Java application, here applications and .jars run by creating a process and they are shutdown by process.destroy().
My problem is that the process that will be doing the killing will be run from the command line, or a separate java program, so the only method of killing the process is to find the PID from ps and then use the linux kill command to kill the processes. So what is the equivalent flag in kill to the process.destroy()?
Thanks for the reply, does java use the equivalent of -9 in its process destroy? Killing everything with no chance of running and cleanup scripts etc?
We have the example of Process.destroy() in the program source code, however we are unable to kill the processes from Java as we will be launching through the command line and will not be starting processes in Java. We dont want to be too heavy-handed if possible, so would prefer to only use -9 as a last resort.