我必须执行RegAlloc.jav
带有输入重定向的程序(4.miniIR
文件)
try{
String s="java -classpath MiniRA/ RegAlloc < MiniRA/4.miniIR";
Process pro2 = Runtime.getRuntime().exec(s);
BufferedReader in =new BufferedReader(new InputStreamReader(pro2.getInputStream()));
String line = null;
while ((line = in.readLine()) != null) {
text+=line;
text+="\n";
System.out.println(text);
}
System.out.println(text);
}
catch(IOException e) {
System.out.println("not Okey");
}
但我没有得到正确的结果;输出窗口只是显示,不会终止程序。谁能帮我找出错误?