在Hadoop上用Java代码运行exe文件

时间:2015-03-24 20:25:54

标签: java hadoop exe hdinsight

我正在尝试在Hadoop上运行我的Java代码(HDInsight实现)。我没有exe文件的来源,所以我必须像它一样运行它。在exe的输入必须是文件,所以我不能使用流媒体。我试图使用ShellCommandExecutor,但它失败了。

String[] command = new String[] { "C:/pepnovo3/PepNovo",
                    "-file", "smallinputfile.mgf", "-model", "CID_IT_TRYP" };
ShellCommandExecutor shell = new ShellCommandExecutor(command);
shell.execute();

这给了我例外:

java.io.IOException: Cannot run program "C:/pepnovo3/PepNovo": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)

我也试图使用ProcessBuilder,它也失败了(同样的原因)。我也试图从HDFS做到这一点,也失败了。 我知道,Hadoop并不是完美的平台,但这是我的任务。它甚至可以做到吗?

1 个答案:

答案 0 :(得分:0)

有三种可能性:

  • 所有节点上都是可执行文件吗?
  • 是否在作业的工作目录中引用了文件(smallinputfile.mgf)(例如,使用-files参数放置)?
  • 作业的Hadoop用户是否对文件夹和文件具有安全权限才能执行?

如果有帮助,请告诉我!