gpt4 book ai didi

java - 如何清除 Java 中的控制台 - Eclipse

转载 作者:塔克拉玛干 更新时间:2023-11-01 23:07:24 54 4
gpt4 key购买 nike

如何在 Eclipse 中执行/打印一些语句后清除控制台。我用过 flush() 但没有用。只是发布示例代码。

System.out.println("execute ");
System.out.println("these set of lines ");
System.out.println("first");

Thread.sleep(2000); // just to see the printed statements in the console
System.out.flush(); // it is not clearing the above statements

最佳答案

Eclipse 控制台不支持clear screen 和其他 ANSI 转义序列 的解释为此需要。此外,ANSI Escape in Console Eclipse 插件不支持清屏

在即将于2019年12月18日发布的Eclipse IDE 2019-12 (4.14)中,对反斜杠(\b) 和回车 (\r) 字符可以在首选项中启用(参见 Eclipse 4.14 - New and Noteworthy - Control character interpretation in Console View ):

enter image description here

关于java - 如何清除 Java 中的控制台 - Eclipse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37301530/

54 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com