Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to figure out what error my Java Eclipse project has?

Tags:

java

eclipse

I've created a Java project from existing source with an Ant build script in Eclipse. I cannot run my project because Eclipse tells me that there is at least one error in it.

Now, I know that the project runs fine on the command line, so I suspect an Eclipse configuration error.

As far as I can tell, the only feedback that I have from Eclipse is

  1. a little red X on my project in the Package Explorer window Eclipse Error Package Explorer
    (source: gregmattes.com)

  2. and dialog window when I try to run the project says there are errors in the project Eclipse Error Dialog
    (source: gregmattes.com)

This is all wonderful, but what is the error?

Is there a "show me the next error" button somewhere?

In the past, on other Eclipse projects, I've notice other little red X's on folders containing source files with errors, the little red X's appear on the source files as well. I scanned (manually) through all of the source files and I haven't found any other red X's (again, where is the "next error" button?).

If I select the "Proceed" button I am greeted with a java.lang.NoClassDefFoundError for my main class, which makes me suspect a classpath issue. I've checked the classpath, and I'm fairly certain that it's correct. Is there a way to see the exact jvm command line that Eclipse is invoking? I realize that it might be invoking the JVM programmatically, and not on a "real" command line. In any case, is there a way, other than the run configuration dialog, to see what is actually happening when I hit the "Proceed" button?

like image 375
Greg Mattes Avatar asked Mar 20 '10 20:03

Greg Mattes


People also ask

How can I see all errors in Eclipse?

Show activity on this post. On Eclipse Helios click on the triangle pointing down on the Problems view, select Preferences then in the Preference dialog that appear, you can change the Limit visible items per group to change the value. Or else uncheck Use marker limits checkbox to allow all items being visible.

How do I get an error console in Eclipse?

-Go to Window->Preferences->Run/Debug->Console the option "Show when program writes to standard error" is toggled on.

How do I view logger information in Eclipse?

During development, you can browse and manipulate the platform log file using the Error Log view (Window > Show View > General > Error Log). You can also have the log file mirrored in the Java console by starting Eclipse with the -consoleLog command-line argument.


1 Answers

The errors are shown in the Problems view. If it is not opened, go to:

Window > Show View > Problems

alt text

Also accessible with the keyboard shortcut Alt+Shift+Q,X

like image 69
Bozho Avatar answered Oct 04 '22 21:10

Bozho