I\'m creating subprocesses in this way:
String command = new String(\"some_program\");
Process p = Runtime.getRuntime().exec(command);
How
Well there is no documented way to do this, but it happens that the Process implementation class is UNIXProcess, and it has a pid field. So you could use reflection to access this private field to get the ID. Googling around you will find other tricks of calling another shell to get ps output and that kind of thing. Nothing easy.