I would like to redirect a java process output towards the standard output of the parent java process.
Using the ProcessBuilder class as follows:
public
You did miss a key piece, you actually need to start your process and wait for your output. I believe this will work,
processBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
// Start the process.
try {
Process p = processBuilder.start();
// wait for termination.
p.waitFor();
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}