我得不到合适的答案.. 我的代码是
String s="java -classpath MiniRA/ RegAlloc < MiniRA/4.miniIR";
Process pro2 = Runtime.getRuntime().exec(s);
System.out.println("Okey");
BufferedReader in = new BufferedReader(new InputStreamReader(pro2.getInputStream()));
String line = null;
System.out.println("Okey");
while ((line = in.readLine()) != null) {
text+=line;
text+="\n";
}
System.out.println(text);
但我得到的结果为非终止输出窗口
koha@ubuntu:~/pjt_new/P3$ java demo
Okey
Okey
^Z
[1]+ Stopped java demo
koha@ubuntu:~/pjt_new/P3$