-1
我不得不執行程序RegAlloc.jav
一個與輸入重定向(4.miniIR
文件)執行在子目錄程序時,在Java exec命令無法正常工作
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");
}
,但我沒有得到正確的結果;輸出窗口剛剛顯示,不會終止程序。任何人都可以幫我找到錯誤嗎?
請問你的新問題,從[一個你問40分鐘前]不同(http://stackoverflow.com/questions/19158586/redirection-in-exec-method-in-java) ? –
[他們](http://stackoverflow.com/questions/19116465/how-to-execute-a-java-program-using-another-java-program-stored-in-a-sub-directo)[是] (http://stackoverflow.com/questions/19134496/how-to-run-a-java-program-stored-in-sub-directory-from-another-java-program-in-t)[everywhere](http ://stackoverflow.com/questions/19158586/redirection-in-exec-method-in-java)! –
@ n.st這就解釋了'它對我來說是迫切的。:(' – devnull