How to call external executable file from java

懵懂的女人 提交于 2019-12-13 21:15:14

问题


I am new to java...

I have a problem while trying to call external executable file from java...

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

while trying to call this getting below error..

Exited with error code 1

回答1:


Are you sure your terminal.exe is in the Windows path?
You can try and replace it with notepad.exe, for example, to see if it works.



来源:https://stackoverflow.com/questions/5934341/how-to-call-external-executable-file-from-java

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!