0

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?

Bionix1441
  • 1,867
  • 1
  • 24
  • 56
  • in the link : http://stackoverflow.com/questions/4750470/how-to-get-pid-of-process-ive-just-started-within-java-program, you can get : Java 9 class Process has new method long getPid() – guillaume girod-vitouchkina Mar 21 '17 at 14:08

1 Answers1

1

Until Java 8 (included), you have to use workarounds.

From Java 9 onwards, there is a new getPid method in the Process class.

Community
  • 1
  • 1
assylias
  • 310,138
  • 72
  • 642
  • 762