java System.out.println 在 Intellij Idea 中写入何处?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31656596/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 18:56:14  来源:igfitidea点击:

System.out.println where does it write to in Intellij Idea?

javaintellij-ideaconsoleoutput

提问by Greyshack

I can't find the terminal where the message is supposed to show. How is it called? I'm guessing it should be in View->Tool Windows but nothing from there seems to work. It's a Maven project and all I can see is GlassFish log.

我找不到应该显示消息的终端。怎么称呼?我猜它应该在 View->Tool Windows 中,但似乎没有任何效果。这是一个 Maven 项目,我只能看到 GlassFish 日志。

回答by Javaru

System.outand System.erroutput is written to either the Runor the Debugtool window depending on whether you launch the run/debug configuration as Run or Debug. See https://www.jetbrains.com/idea/help/running-and-debugging.htmland https://www.jetbrains.com/idea/help/run-tool-window.htmlfor more information (Same information is in the Help guide of the IntelliJ IDEA Ultimate version).

System.out并且System.err输出写入无论是RunDebug根据您是否启动运行/调试配置,运行或调试工具窗口。有关更多信息,请参阅https://www.jetbrains.com/idea/help/running-and-debugging.htmlhttps://www.jetbrains.com/idea/help/run-tool-window.html(相同信息在 IntelliJ IDEA Ultimate 版本的帮助指南中)。

回答by Hamid Mohayeji

In Java EE applications with Tomcat container, if you want to see the result of prints like System.out.println(), first go to Run > Edit Configurations and select your tomcat server in the left menu, then open Logs tab and check 'Show console when a message is printed to standard output stream'

在带有 Tomcat 容器的 Java EE 应用程序中,如果您想查看类似 的打印结果System.out.println(),请首先转到“运行”>“编辑配置”并在左侧菜单中选择您的 Tomcat 服务器,然后打开“日志”选项卡并选中“打印消息时显示控制台”到标准输出流'

回答by 0__1

Click on the below image to figure out.

点击下图了解一下。

For running mode:

对于运行模式:

View -> Tool Windows -> Run

查看 -> 工具窗口 -> 运行

For debugging mode:

对于调试模式:

View -> Tool Windows -> Debug

查看 -> 工具窗口 -> 调试

You must be on one of the above two states in order to accomplish this action.

您必须处于上述两种状态之一才能完成此操作。

How to show the terminal window on IntelliJ

如何在 IntelliJ 上显示终端窗口