检查你配置的java环境变量有没有问题,跟idea没有关系的
不知道你这个问题是否已经解决, 如果还没有解决的话:在网上有看到各种的实现方法,比如:
Runtime.getRuntime().exec("cls");
或者:
public static void clear() {
System.out.print("\033[H\033[2J");
System.out.flush();
}
还有:
import java.io.IOException;
class Clear {
public static void main(String... arg) throws IOException, InterruptedException {
new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
}
}
但是好像都不管用,所以这里给大家提供了两种正确的解决方法,话不多说,直接安排!