2016-06-13 2375 views
0

我正在使用Java版本1.7爲IntelliJ開發Android版。我沒有一直有這種性質的任何問題,直到我這樣做:紅色IntelliJ IDEA - 無法解析方法

ProcessBuilder p = new ProcessBuilder("echo", "hello world") 
      .redirectErrorStream(true) 
      .directory(dirFile) 
      .redirectOutput(new File("")); 

的IntelliJ亮點「redirectOutput」當我在它的鼠標,它說:

無法解析法「 redirectOutput(java.io.File中的)」

我試圖重建,無效緩存和重新啓動等

回答

2

的ProcessBuilder doesn't支持.redirectOutput。 瞭解更多關於它here

嘗試使用類似this之類的東西。

+0

該死的。我將不得不寫一些從進程讀入輸入並將其寫入文件的東西呢? – Infamous911

+0

我編輯了答案,可能會有所幫助 – BohdanZ