【问题标题】:How to call external executable file from java如何从java调用外部可执行文件
【发布时间】:2011-05-09 16:38:27
【问题描述】:

我是java新手...

我在尝试从 java 调用外部可执行文件时遇到问题...

Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("cmd /c terminal.exe");

在尝试调用此错误时..

Exited with error code 1

【问题讨论】:

  • 如果你打开一个windows命令shell并输入“cmd /c terminal.exe”会发生什么?

标签: java runtime


【解决方案1】:

您确定您的 terminal.exe 在 Windows 路径中吗?
例如,您可以尝试将其替换为notepad.exe,看看它是否有效。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-08-27
    • 1970-01-01
    • 1970-01-01
    • 2014-03-08
    • 1970-01-01
    • 2011-04-21
    • 2016-06-20
    • 2012-10-24
    相关资源
    最近更新 更多