我沒有找到任何清除Java-9 JShell控制檯的命令。我也嘗試通過此程序清除JShell控制檯,但它也不起作用。如何清除Java 9 JShell控制檯?
import java.io.IOException;
class CLS {
public static void main(String... arg) throws IOException, InterruptedException {
new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
}
}
我認爲我們在早期訪問中尚未提供該功能。任何人有想法?
存在解決此問題的開放式錯誤:https://bugs.openjdk.java.net/browse/JDK-8153762?jql=project%20%3D%20JDK%20AND%20component%20%3D%20tools% 20AND%20Subcomponent%20%3D%20jshell%20ORDER%20BY%20status%20DESC –
這不是*錯誤*,它是一項功能請求。我的答案提供了一種解決方法。 – Maroun
你是對的@MarounMaroun,抱歉,錯誤的措辭。這絕對是未來的要求。 –