io - Sharing i/o between java programs -
io - Sharing i/o between java programs - this question regards redirection of input , output between 2 java programs. source code simplified illustration of problem below. this prog1: import java.io.*; public class prog1{ public static void main(string[] args) throws ioexception{ runtime rt = runtime.getruntime(); process prog2 = rt.exec("java prog2"); system.out.println("prog2 has executed."); } } on separate file, i've written prog2, execute net explorer verify execution successful: import java.io.*; public class prog2{ public static void main(string[] args) throws ioexception{ bufferedreader in = new bufferedreader(new inputstreamreader(system.in)); system.out.print("enter string: "); system.out.println("you entered " + in.readline() + ". starting explorer..."); runtime.getruntime().exec("c:\\program files (x86)\\internet explorer\\iexplo