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

新手上路,请多包涵

在 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

原文由 Chandra Shekhar 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 879
1 个回答

Eclipse 控制台不支持清晰屏幕 的解释以及为此所需的其他 ANSI 转义序列。此外, 控制台 Eclipse 插件中的 ANSI Escape 不支持 _清屏_。

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

在此处输入图像描述

原文由 howlger 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
logo
Stack Overflow 翻译
子站问答
访问
宣传栏