Eclipse Problems View not showing Errors anymore

Viewed 179000

For some reason Eclipse is no longer showing me Java compilation Errors in the Problems View.

It is still showing Warnings.

This has suddenly happened and I cannot think of anything that I have changed which would affect this.

I am using the "Maven Integration for Eclipse" plugin but I have been for some time - not sure if this could have affected it or not.

Any ideas?

28 Answers

I had same problem and randomly did such things as (several times):

1) Project->Clean...,
2) close and open Eclipse again,
3) Run As...

And it started to work again, without changing configuration.

I installed and deinstalled ajdt-plugin and got the same problem.

Check <Project><Properties><Builders>. It should have a 'Java Builder'.

This code should be in the .project file (file is in the root of your project):

<buildSpec>
        <buildCommand>
                <name>org.eclipse.jdt.core.javabuilder</name>
                <arguments>
                </arguments>
        </buildCommand>
</buildSpec>
<natures>
        <nature>org.eclipse.jdt.core.javanature</nature>
</natures>

What worked for me is creating a New Problems View (this option is accessible from the three-dots View options):

screenshot showing 'New Problems View' option

The new View does show all the warnings and errors that were detected:

enter image description here

At the top right corner of the problems window (next to minimize) there is a small arrow-icon. Click it and select "Configure filters". There is a severity filter that might have been activated.

This is normal problem. In wich order and export function sometimes get turned off.

right click on project<properties< there u hav option build path < and there ORDER AND EXPORT< click right all the options....all the things are right back.

On Ganymede, check the configuration of the Problem view:

('Configure content') It can be set on 'any element in the same project' and you might currently select an element from the project.

Or it might be set on a working set, and this working set has been modified

Make sure that 'Match any configuration' is selected.

If you have reached here that means all the other solutions did not work for you. One reason could be your source folder is not a java project.

Solution would be to run below command on the source folder

mvn eclipse:eclipse

This worked for me.

If this also doesn't work then try removing .classpath and .project file and run the above command again

I could reproduce this issue by creating an enumeration with a non-static member class and a static block enumerating its values:

public enum Foo {
Dummy(new Bar [] {new Bar()});
static {
    for (Foo foo: Foo.values());
}
private Foo(Bar [] params) {}
public class Bar {}
 }

This class breaks the Ganymede compiler. If you delete the line in the static initializer block, the code compiles correctly again, and you get the error that there is no enclosing instance for the new Bar() call, as expected.

-- correction: The above holds only if the project has gaeNature from Google Appengine. However, if you get an error similar as mentioned in the original question, you might be encountering another java compiler bug ...

My mistake was that I was creating classes in resource package...

Creating classes in src/main/java solved the issue.

Check your filters, sometimes problem view could be scoped to a working set that you are not currently working in. Also, you can check other configurations for the problem view.

enter image description here

Problem in .classpath I did "Replace with HEAD revision" to get back the version that I had in the repository Git and the errors appear again.

Duplicates in build path

In my case, errors were not showing up in the Problems View or Package Explorer views because my build path had duplicate entries for src and test directories:

enter image description here

Removing these from Project -> Properties -> Build Path (and just leaving one each) did the trick.

Related