问题描述
我已经设置使用cmd作为终端,但是当我输入cls或使用 Runtime.getRuntime().exec("cls")
时,我得到一个IOException,提示无法运行程序"cls"系统找不到指定的文件.
I have it setup to use cmd as the terminal but when I type cls or use Runtime.getRuntime().exec("cls")
I get a IOException saying Cannot run program "cls" the system cannot find the file specified.
有什么方法可以将本地终端命令保留在IntelliJ的嵌入式终端中?
Is there any way to keep native terminal commands within the embedded terminal in IntelliJ?
推荐答案
方法 Runtime.getRuntime().exec(此处的某些命令")
如果发生I/O错误,将抛出IOException,而未知命令可能会导致这种情况的发生.
这就是说 cls
命令根本没有在 PATH
环境中定义.
Method Runtime.getRuntime().exec("some command here")
will throw IOException if an I/O error occurs, and unknown command could cause the occurrence of this situation.
that's to say cls
command was not defined in the PATH
environment at all.
这篇关于IntelliJ 14透明控制台/终端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!