There is no way of doing "directly" from Java.
You will need to do something specific for Windows / Linux, in each case executing an external program, or invoking native code.
On Linux, you can use kill
as you suggest.
On Windows, you can call SuspendThread()
, or maybe you can launch the SysInternals tool 'PsSuspend'. There is some information that may help you here:
How to pause / resume any external process under Windows?
How to suspend/resume a process in Windows?
If you wish to invoke native code from Java, JNIWrapper may help you.
Also, if you need the PIDs of the spawned processes, then you may need to launch them via native code also, as Java will not give you their PIDs.