Discussion Locked

Redirect output with Runtime.exec

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
The Dec. 23, Java TechMail discusses the use of the Runtime.exec. Have you redirected output from native programs run from within Java using Runtime.exec? How did you get around the limitations outlined in this tip?

2 replies

by solrak29

This is not an issue on WinX platforms....
And I can't seem to execute a simple "dir" command. I had to create a bat file that did the work. But redirection was not a problem at all.

Any comments on that?

by per lundholm

The example code in the article may fail if the started program blocks on error output.

Instead, you should read the streams using a thread for each.

This discussion is closed to new replies.