I am invoking a command which spawns two processes
Process p = Runtime.getRuntime().exec("<...>\bin\\script");
" process 1 with the pid 1234, process 2 with the ppid 1234, pid 3456 "
I can get the process id(1234) by the following code :
String name = ManagementFactory.getRuntimeMXBean().getName();
String processId = name.split("@")[0];
System.out.println("Process ID for this app = " + processId);
But I cant get the other process's id (3456). Is there a way to extract all the child process ids from a process?