简体   繁体   English

显示System.out.println的输出

[英]Show output of System.out.println

How do I show the output of System.out.println("Hello World!") ? 如何显示System.out.println("Hello World!")

I can only get the output when using System.err.println("Hello World!") . 我只能在使用System.err.println("Hello World!")时获得输出。

I'm running the java program from the command line. 我从命令行运行Java程序。

You should see both traces (out and err). 您应该看到两条迹线(输出和错误)。

Have you redirected the output when running the command (for example: "java MyClass > myLogFile.log")? 运行命令时是否已重定向输出(例如:“ java MyClass> myLogFile.log”)?

Are you using pipes (for example: "java MyClass | grep something")? 您是否在使用管道(例如:“ java MyClass | grep something”)?

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

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