Java Eclipse Juno 中没有控制台输出

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18504493/
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-08-12 08:37:58  来源:igfitidea点击:

No console output in Eclipse Juno

javaeclipseconsoleeclipse-juno

提问by

Pretty straight forward. I've been working in Eclipse Juno for a while now and my console always worked. When you output to the console with

很直接。我已经在 Eclipse Juno 中工作了一段时间,我的控制台一直在工作。当你输出到控制台时

System.out.println("Something");

System.out.println("东西");

In java, or just when you compile and build your project there's always someoutput in the console. But today, I started up the IDE, and nothing. No console output. I've restarted Eclipse, reset the perspective.. Nothing is happening.

在 java 中,或者只是在编译和构建项目时,控制台中总会有一些输出。但是今天,我启动了 IDE,什么也没有。没有控制台输出。我已经重新启动了 Eclipse,重新设置了透视图……什么也没有发生。

Using the Java EE version just btw. Any help would be appreciated. Thanks!

顺便说一句,使用 Java EE 版本。任何帮助,将不胜感激。谢谢!

SOLVED: So after struggling for how long, I shut down my server. Killed eclipse. And restarted everything and the console is now working again. No idea how this happened in the first place.

已解决:所以在挣扎了多久之后,我关闭了我的服务器。杀了日食。并重新启动一切,控制台现在又可以工作了。一开始不知道这是怎么发生的。

回答by Gaurav Varma

Go to Window->Show View -> Console

转到窗口-> 显示视图-> 控制台

回答by Jason Sperske

There is a small pull-down icon on the right of the console that lets you select which console you want to see. Maybe you accidentally selected a different console.

控制台右侧有一个小的下拉图标,可让您选择要查看的控制台。也许您不小心选择了不同的控制台。

回答by kondapaka

for this same i did the following things and it's worked for me

为此,我做了以下事情,它对我有用

Here's what i did:

这是我所做的:

[1] Uninstall - Removed all traces of Eclipse (64-bit). - Removed all traces of MinGW (and/or Cygwin). - Removed all traces of Java (SDK and JRE).

[2] Restart PC

[3] Install - Installed latest Java JDK (includes the JRE) 32-bit. - Installed Eclipse IDE (Java Edition) 32-bit. - Installed MinGW (with Msys). - Installed the necessary CDT tools from within Eclipse.

And it works fine!

For installation compiler/CDT installation, i followed this guide (making my own alterations where needed): http://max.berger.name/howto/cdt/cdt.jsp

Hope it works for you! And thanks for the tip-off that it was working 100% on a 32-bit machine. Very Happy

[1] 卸载 - 删除了 Eclipse(64 位)的所有痕迹。- 删除了 MinGW(和/或 Cygwin)的所有痕迹。- 删除了所有 Java 痕迹(SDK 和 JRE)。

[2] 重启电脑

[3] 安装 - 安装最新的 Java JDK(包括 JRE)32 位。- 安装 Eclipse IDE(Java 版)32 位。- 安装了 MinGW(使用 Msys)。- 从 Eclipse 中安装了必要的 CDT 工具。

它工作正常!

对于安装编译器/CDT 安装,我遵循了本指南(在需要时进行自己的更改):http: //max.berger.name/howto/cdt/cdt.jsp

希望这对你有用!并感谢您提示它在 32 位机器上 100% 工作。很高兴

回答by Narendra Pathai

Go to run as and choose Run Configurations -> Commonand in the Standard Input and Output configuration see if Allocate Consoleis selected.

转到运行方式并选择Run Configurations -> Common并在标准输入和输出配置中查看是否Allocate Console被选中。

Run Configurations: enter image description here

运行配置: 在此处输入图片说明

Commons view: enter image description here

公共视图: 在此处输入图片说明

回答by Azertiy

I also had no output in the console after some error. The answer from Narendra Pathai worked for me.

在出现一些错误后,我在控制台中也没有输出。Narendra Pathai 的回答对我有用。

  1. Deselect the Allocate Console

  2. Run the application => I got output in my console directly

  3. Select it again

  1. 取消选择 Allocate Console

  2. 运行应用程序 => 我直接在控制台中得到输出

  3. 再次选择

After doing that, I got output.

这样做之后,我得到了输出。

回答by raja777m

You can just re-open the console view from Window>Show View> Console. It worked for me, just before posting the answer here.

您可以从“窗口”>“显示视图”>“控制台”重新打开控制台视图。它对我有用,就在此处发布答案之前。

回答by Gene

How to System.out to console: Right click on your glassfish (Server Tab) and go to View Log File

如何 System.out 到控制台:右键单击您的 glassfish(服务器选项卡)并转到查看日志文件

enter image description here

在此处输入图片说明

Make sure the console setting is directed at your server.log file:

确保控制台设置针对您的 server.log 文件:

enter image description here

在此处输入图片说明

回答by Helenciya

First Go TO (Window->Show view->Console)

首先转到(窗口->显示视图->控制台)

Then select "Show Console when started out changes" icon in the right end of the console window.

然后在控制台窗口的右端选择“开始更改时显示控制台”图标。

回答by Jabongg

Go to run as and choose Run Configurations -> Common and in the Standard Input and Output configuration see if Allocate Console is selected.

转到 run as 并选择 Run Configurations -> Common,然后在 Standard Input and Output 配置中查看是否选择了 Allocate Console。

Mark file option as ticked and browse to your current workspace. This will work for you

将文件选项标记为已勾选并浏览到您当前的工作区。这对你有用

回答by Alex

For me, using eclipse-luna the problem was related to a specific workspace. Whenever I used this workspace, one specific plugin failed to do console-output. I re-installed the plugin, I even re.installed eclipse itself and whiped out the ".eclipse-luna" folder, but the problem still was there.

对我来说,使用 eclipse-luna 的问题与特定的工作区有关。每当我使用这个工作区时,一个特定的插件无法执行控制台输出。我重新安装了插件,我什至重新安装了 eclipse 本身并取出了“.eclipse-luna”文件夹,但问题仍然存在。

I finally fixed the problem by deleting the folder ".metadata" in this workspace.

我最终通过删除此工作区中的文件夹“.metadata”解决了这个问题。