0

I use Eclipse on two different computers. Everything works fine on the one at school but on my laptop the console doesn't show standard errors, instead it just stays blank. For instance, this program purposefully generates an error:

String [] string = new String [3];
string [4] = "foo";

On the school's computer this returns

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4

I'd like my laptop to do the same but it stays blank: BlankConsole

These are my console preferences: Preferences

Note: I'm using Windows and the school's computer is a Mac.

  • 1
    did you tried to run program by adding lines like `System.out.print(mark1)' – bananas Oct 15 '19 at 04:18
  • Have you tried running the application outside IDE. – Sujay Mohan Oct 15 '19 at 04:18
  • Possible duplicate of [Eclipse Problems View not showing Errors anymore](https://stackoverflow.com/questions/253357/eclipse-problems-view-not-showing-errors-anymore) – Villat Oct 15 '19 at 04:28
  • Printing the variable causing the error has the same effect. I'm not sure how to run outside the IDE, I tried using the command prompt but it shows 'could not load or find main class' and I'm stuck at that. Sorry, I'm new to Java. I also tried all the suggestions in that thread, none worked. – Dr. Ostrich Oct 15 '19 at 06:29
  • According to your console's screenshot it looks like the execution never ended (no '' before console's name and the terminate button is still red). Hence the issue may not be the console printing nothing but rather the execution never starting/being stuck somewhere (don't know what could cause this though). Did you try to run with another JRE? – Emmanuel Chebbi Oct 15 '19 at 11:03

2 Answers2

0

I don't know if this will work or not but still give it a shot:

  1. Click on Project in the menu bar and select Clean
  2. Click on File in the menu bar and select Restart
  3. After Eclipse restarts, try running your program and see if it is solved or not

This is in no way a permanent solution to your problem but it just might be a quick fix to it.

Mohit Dodhia
  • 333
  • 4
  • 15
0

So I went ahead and reinstalled Eclipse, I don't know why but it appears to be working now.