If you launch a program using Runtime.exec(), you get back a Process object. You can use getErrorStream() and getOutputStream() on the Process object to extract the output.
There are problems, though. You have to ensure that the program you launch doesn't ever stop and ask for input, even on error conditions. I also had problems when I used a buffer on the output and it would block until sufficient characters came in - it seems to me I ended up making the buffer just a few characters long... "When you have eliminated the impossible, whatever remains, however
improbable, must be the truth." ~ Arthur Conan Doyle
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.