无法通过 ProcessBuilder 运行 Scala
当我尝试
processBuilder = new ProcessBuilder("scala", "-classpath", CLASSPATH, CLASSNAME);
process = processBuilder.start;
process.waitFor;
在 Eclipse Helios IDE 上的 Scala 应用程序中运行时,它会生成
java.io.IOException: Cannot run program "scala": CreateProcess error=2, The system cannot find the file specified.
我已经配置了 Windows 系统环境变量 Path 并且 scala 在 Windows 命令行上运行正常。我还将变量 Path 添加到 Eclipse 运行配置中。
When I try to run
processBuilder = new ProcessBuilder("scala", "-classpath", CLASSPATH, CLASSNAME);
process = processBuilder.start;
process.waitFor;
within an Scala application on Eclipse Helios IDE, it yields the
java.io.IOException: Cannot run program "scala": CreateProcess error=2, The system cannot find the file specified.
I've already configured the Windows system environment variable Path and scala runs OK on Windows command line. I've also added the variable Path into Eclipse run configuration.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑这里的问题是您需要传递 scala.bat,而不是 scala。要缩小问题范围,您应该尝试运行其他程序,看看哪些程序可以运行或不能运行。
I suspect the problem here is that you need to pass
scala.bat
, notscala
. To narrow down the problem, you should try running other programs, to see what you can or cannot run.