具有绝对值的Runtime.exec?

时间:2013-09-10 16:50:54

标签: java string runtime

我有:

Process p = Runtime.getRuntime.exec ("Rscript "+ hallo +""),

其中“hallo”是一个包含脚本绝对路径的String。

然而,这不起作用,因为exitValue为2,因此找不到该文件。 有没有办法将String对象传递给Runtime.exec?

编辑:

通过简单地传递“Rscript”+ hallo找到了一种方法。

但是,我的退出值仍为2.这怎么可能?我知道绝对路径是正确的,因为我是通过file.getAbsolutePath获得的。

0 个答案:

没有答案