相关疑难解决方法(0)

java.io.IOException:error = 11

我遇到了一个奇怪的Java问题ProcessBuilder.代码如下所示(略微简化)

public class Whatever implements Runnable
{

public void run(){
        //someIdentifier is a randomly generated string
        String in = someIdentifier + "input.txt";
        String out = someIdentifier + "output.txt";
        ProcessBuilder builder = new ProcessBuilder("./whateveer.sh", in, out);
        try {
            Process process = builder.start();
            process.waitFor();
        } catch (IOException e) {
            log.error("Could not launch process. Command: " + builder.command(), e);
        } catch (InterruptedException ex) {
            log.error(ex);
        }
}

}
Run Code Online (Sandbox Code Playgroud)

whatever.sh读取:

R --slave --args $1 $2 <whatever1.R >> r.log    
Run Code Online (Sandbox Code Playgroud)

大量的实例Whatever被提交到ExecutorService …

java linux process processbuilder

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

java ×1

linux ×1

process ×1

processbuilder ×1