简体   繁体   English

Eclipse 控制台未显示 output

[英]Eclipse Console not showing output

I have written a simple class having an SOP statement for "Hello World".我写了一个简单的 class,它有一个“Hello World”的 SOP 语句。 But the Eclipse console is not showing output. I then wrote the same program in a previously created project and it worked fine.但是 Eclipse 控制台没有显示 output。然后我在之前创建的项目中编写了相同的程序并且运行良好。 I am opening the Console as given below:我正在打开控制台,如下所示:

Window->Show View->Console.窗口->显示视图->控制台。

But it is not working.但它不起作用。 I am using j2ee project in the same workspace.我在同一工作区中使用 j2ee 项目。 Any idea?任何的想法? Please help.请帮忙。 I am stuck because of this problem.因为这个问题,我被困住了。

Go to "Window > Reset Perspective", that will reset the window settings to default.转到“窗口>重置透视”,这会将窗口设置重置为默认值。 Next, you might need to stop any running Java processes.接下来,您可能需要停止任何正在运行的 Java 进程。 I suggest you then click "Remove all Terminated Launches" and if the red "Terminate All" is still available click that as well我建议您然后单击“删除所有终止的启动”,如果红色的“终止所有”仍然可用,请单击它

删除所有终止的启动

[working] I encountered the same problem, I tried with all the solutions provided above but it didn't work then I came to a solution which worked. [工作] 我遇到了同样的问题,我尝试了上面提供的所有解决方案,但没有用,然后我找到了一个有效的解决方案。 Follow the following process to overcome the problem.请按照以下过程解决该问题。

Right click on workspace provided by Eclipse --> Select "Run As" --> Java Application.右键单击 Eclipse 提供的工作区 --> 选择“运行方式” --> Java 应用程序。

在此处输入图片说明

This will work definitely.这肯定会奏效。

Make sure that the project structure should be as follows:确保项目结构应如下所示:

在此处输入图片说明

Make sure that your System.out.println("Hello World") is in main method with proper signature.确保您的 System.out.println("Hello World") 在具有正确签名的main方法中。

Ex:前任:

public static void main(String[] args){
System.out.println("Hello World");
}

None of the above.以上都不是。 What helped in my case:什么对我有帮助:

Run > Run configurations > Common > uncheck Launch in background (last tab all the way at the bottom).运行>运行配置>通用>取消选中在后台启动(最后一个选项卡一直在底部)。

Then it showed the error why the thing wouldnt start.然后它显示了为什么事情不会启动的错误。

In my case: a project dependency to a project which I had closed.就我而言:项目依赖于我已关闭的项目。

See (rightclick) Project > Build path > Configure build path .请参阅(右键单击)项目>构建路径>配置构建路径

Click on Helps on the top bar.单击顶部栏中的帮助。 then click on Check for Updates.然后点击检查更新。 And update whatever updates are generated for your IDE.并更新为您的 IDE 生成的任何更新。 Helps> Check for Updates > ....帮助>检查更新> ....

Hope it will fix your problem.希望它能解决你的问题。

Double-check you actually saved your file.仔细检查您是否确实保存了文件。 Many of us forget to save the file and simply hit run.我们中的许多人忘记保存文件并直接点击运行。

转至运行>运行配置>鼠标双击Java应用程序>首页>输入你的路径>完成

Sometimes it is possible that number of character console can accomodate is beyond capacity, so increase the buffer size of console.有时控制台可以容纳的字符数可能超出容量,因此增加控制台的缓冲区大小。 windows>prefences>console -increase buffer size windows>prefences>console - 增加缓冲区大小

I had the same problem just figured out the solution.我遇到了同样的问题,只是想出了解决方案。 Just check your main method it would be只需检查您的主要方法即可

public void main(String[] args){ 

just change it to this:只需将其更改为:

public static void main(String[] args){

I had the same problem using jre7.我在使用 jre7 时遇到了同样的问题。 Changed to jdk 1.7 and Eclipse console started showing outputs again.更改为 jdk 1.7,Eclipse 控制台再次开始显示输出。

  1. Just right click on console window and click Terminate /Disconnect all .只需右键单击控制台窗口,然后单击Terminate /Disconnect all
  2. Run the class again再次运行类
  3. Done !!!完毕 !!!

I've lost the console only in the Java default perspective and I wasn't able to show it again by using window > show view > console .我只在 Java 默认透视图中丢失了控制台,我无法使用window > show view > console再次显示它。

What I did is the following :我所做的是以下内容:

  1. window > Perspective > reset perspective窗口 > 透视 > 重置透视
  2. window > show view > console窗口 > 显示视图 > 控制台

and It appears now!!它现在出现了!!

If eclipse is not showing path,如果日食没有显示路径,

Please click on RUN-> Run configuration->click on environment tab->click on New-> add a path variable as mingw_path(if compiler is mingw in case of c++ ) and set value as C:\\MinGw\\bin (please check ur mingw bin path then only set).请点击运行->运行配置->点击环境选项卡->点击新建->添加一个路径变量作为mingw_path(如果在c++的情况下编译器是mingw)并将值设置为C:\\MinGw\\bin(请检查然后只设置你的 mingw bin 路径)。

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

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