16

I have written a simple class having an SOP statement for "Hello World". But the Eclipse console is not showing output. I then wrote the same program in a previously created project and it worked fine. 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. Any idea? Please help. I am stuck because of this problem.

Arbaz Alam
  • 1,172
  • 1
  • 14
  • 24
user3497430
  • 161
  • 1
  • 1
  • 4

14 Answers14

25

Go to "Window > Reset Perspective", that will reset the window settings to default. Next, you might need to stop any running Java processes. I suggest you then click "Remove all Terminated Launches" and if the red "Terminate All" is still available click that as well

Remove all Terminated Launches

Elliott Frisch
  • 198,278
  • 20
  • 158
  • 249
4

[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.

enter image description here

This will work definitely.

Rahat Rajdev
  • 285
  • 2
  • 7
4

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.

What I did is the following :

  1. window > Perspective > reset perspective
  2. window > show view > console

and It appears now!!

zoubair Omar
  • 106
  • 1
  • 5
2

Make sure that the project structure should be as follows:

enter image description here

Rakesh KR
  • 6,357
  • 5
  • 40
  • 55
2

Make sure that your System.out.println("Hello World") is in main method with proper signature.

Ex:

public static void main(String[] args){
System.out.println("Hello World");
}
Anton Kolyaev
  • 306
  • 2
  • 10
1

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.

Meloman
  • 3,558
  • 3
  • 41
  • 51
Hans
  • 51
  • 4
1

Click on Helps on the top bar. then click on Check for Updates. And update whatever updates are generated for your IDE. Helps> Check for Updates > ....

Hope it will fix your problem.

1

Double-check you actually saved your file. Many of us forget to save the file and simply hit run.

m02ph3u5
  • 3,022
  • 7
  • 38
  • 51
Rahul
  • 11
  • 1
1

Go Run > Run Configurations > Double Click Java Application > Main > Enter path to your main > Done!

Friiiday
  • 11
  • 1
1

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

Amit
  • 21
  • 1
0

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){
Taaha Rauf
  • 21
  • 8
0

I had the same problem using jre7. Changed to jdk 1.7 and Eclipse console started showing outputs again.

jbn1981
  • 73
  • 2
  • 9
0
  1. Just right click on console window and click Terminate /Disconnect all.
  2. Run the class again
  3. Done !!!
-1

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).

  • 1
    This question is not asking about how to add PATH. For future contributions, please try to ask for clarifications through comments, if the original question is not clear enough. – TSG Jul 23 '20 at 08:36