简体   繁体   English

我对 Netbeans 11.3 IDE 有问题

[英]I have a problem with the Netbeans 11.3 IDE

There are no problems with the lines of code, but what is bothering me would be this pile of information that appears in the Output window.代码行没有问题,但困扰我的是Output window中出现的一堆信息。 I would like to see only the result of the code, written as I marked it in red:我只想看到代码的结果,我用红色标记了它:

输出窗口

You are freely choosing to write to the Output window in NetBeans, where other NetBeans processes also write their output, so arguably what you want to achieve is not reasonable or prudent, and there is some output in that window which you probably cannot suppress anyway. You are freely choosing to write to the Output window in NetBeans, where other NetBeans processes also write their output, so arguably what you want to achieve is not reasonable or prudent, and there is some output in that window which you probably cannot suppress anyway.

That said, a simple change which may help a lot is to suppress all Maven output except error messages by adding the --quiet setting:也就是说,一个可能有很大帮助的简单更改是通过添加--quiet设置来抑制所有 Maven output 除了错误消息:

  • Tools > Options > Java > and click the Maven tab工具 > 选项 > Java >并单击Maven选项卡
  • Select Execution from the Categories tab, and enter --quiet in the Global Execution Options field. Select类别选项卡执行,并在全局执行选项字段中输入--quiet
  • Click Apply and OK.单击应用和确定。

That should get rid of most of the Maven output in the Output window, but note that:这应该消除 Output Z05B8C7352702FFBF2DE6DZ 中的大部分 Maven output 但请注意:

  • Other NetBeans processes may will still write to it.其他 NetBeans 进程可能仍会写入它。
  • That --quiet setting is global, and will apply to all Maven projects you run within NetBeans.--quiet设置是全局的,将适用于您在 NetBeans 中运行的所有 Maven 项目。

An alternative approach is to direct all Maven output to a file using --log-file {filename} in the Global Execution Options field.另一种方法是使用全局执行选项字段中的--log-file {filename}将所有 Maven output 定向到文件。 You can couple this with the --quiet setting.您可以将其与--quiet设置结合使用。 For example: --log-file d:\temp\mvn1.txt --quiet which will create a file named mvn1.txt which only contains your output.例如: --log-file d:\temp\mvn1.txt --quiet这将创建一个名为mvn1.txt的文件,其中仅包含您的 output。

Yet another possible approach is to direct your application's output to a file independently of Maven.另一种可能的方法是将应用程序的 output 定向到独立于 Maven 的文件。 See this answer for how to do that for simple PrintStream ouput.有关如何为简单的PrintStream输出执行此操作的信息,请参阅此答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM