This question already has an answer here:
- How to get PID of process I've just started within java program? 16 answers
If we use Runtime.exec to create a new subprocess:
Process exec(String command) Executes the specified string command in a separate process.
How to get the value of the created process?