How to redirect output of child processes

I have a main process, in the main process, it calls Runtime.getRuntime().exec("child_process"); to start a child process.

My question is how I could redirect the output of thechild process to the one of the main process (stdout)? I think there should be an easy way to do it but google it doesn't give me any results.

[332 byte] By [principlesa] at [2007-11-27 4:20:14]
# 1
I think you'll have to start a thread from the main process that reads from the child process's output and pumps it to the main process's stdout.
Hippolytea at 2007-7-12 9:27:13 > top of Java-index,Java Essentials,Java Programming...
# 2
I'm surprised that Google didn't find this link for you: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.htmlbecause it is posted in almost every thread here that asks about Runtime.exec. That must be thousands of times by now.
DrClapa at 2007-7-12 9:27:13 > top of Java-index,Java Essentials,Java Programming...
# 3

Thank you all. I expect of some short methods like shelf redirection >, using some special value for stdout etc. However, it seems these don't exit in java programming.

I know how to get the data from outputstream of child process and print it out. But it may be too much for my apps to I think I would better skip.

Again, thank you all.

principlesa at 2007-7-12 9:27:13 > top of Java-index,Java Essentials,Java Programming...