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?
Until Java 8 (included), you have to use workarounds.
From Java 9 onwards, there is a new pid()
method in the Process
class.