Problem in sending inputs to a Process.
I am trying to execute a RPM file from Java using the code shown below.
1)Process proc = Runtime.getRuntime().exec(command);
//Here command is "/bin/sh -c /usr/CI/sample-rpm.bin"
2) read the input stream of the Process in a separate thread and print it to System.out
3) Write the user input from System.in to the output stream of the Process in a separate thread.
This RPM is interactive. It first shows a license agreement and waits for the user input.
I am able to read from the inputstream of this Process and redirect it to System.out. My problem is in sending the user response to this process. I tried accessing the outputstream of this process and writing the user response to this outputstream. But, this does not work. We are using JDK 1.5.
Has anybody faced this problem before? Any inputs would be really helpful.
Many many thanks in advance.