Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to interact (input and output) with Process and Runtime?

807603Aug 20 2007 — edited Jan 8 2008
I'm creating a Java class which will execute other applications or shell scripts.
It works fine for batch processes and applications which just writes stuff on the screen.

But how can I accomplish interaction with a an application in case it requests user input? I know I can use Process.getInputStream() and Process.getOutputStream(), but how can I tell if the sub-process is requesting a user input, and then print out the output again, and so on, until the end of the process?

I don't know if I made myself clear, I only have code to execute and output the sub-process.

Thanks in advance,
Christian
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 5 2008
Added on Aug 20 2007
31 comments
3,099 views