I am creating Processes using ProcessBuilder in my Java Application. The created process executes some FFMPEG commands which actually copy the RTSP streams in specified dest
Maybe try...
builder.inheritIO(); System.exit(2);
Or you could try to write to the stdin of the process...
process.getInputStream().write(exitCode);