Eclipse Problems View not showing Errors anymore

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?

180700 次浏览

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.

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.

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

I have also faced the same problem.

After installing m2eclipse plugin, i was not getting any Java compilation errors.

My solution was to enable dependency management by Select Project -> Right Click (to get context menu) -> m2 Maven -> Enable dependency management.

Now i am able to view Java Compilation Errors.

I have the same problem in slight different situation. I have a parent POM and multiple modules under it. Project was existing and I imported it into eclipse. I can change the "Dependency management" only to parent project but not projects under it. They are not showing any compilation warnings.

Next I'm going to try to change them all into individual projects... that's not what I wanted, but I haven't been able to solve this otherwise...

I have the same issue with Eclipse Helios and the m2eclipse plugin. They just can't seem to get this thing to work with WTP or WPT or whatever the blasted acronym is.

If I do a clean on the project and watch the Maven console then I can see the compilation issues in the console but eclipse won't touch it. It seems eclipse or WTP/WPT and m2eclipse are busy playing slap hands.

I want to post my story here if Google brings you to this question.

Somehow, "Project->Build Automatically" got turned off.

Turning it back on produces correct errors list.

In my case it has nothing to do with m2e 1.0. This is default behavior for any Java project and goes back as far as Ganymede ( at the point of writing this post I am running Indigo )

I was experiencing this problem as well today. The other solutions presented here (such as cleaning the project and restarting Eclipse) did not work or were not applicable to my setup. What did work for me was right-clicking on the project in the Package Explorer and selecting Maven->Update Project Configuration. Evidently some source folder restructuring I had done the previous day had caused Maven to lose track of things, and issuing this command fixed everything.

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>

In my case Eclipse wasn't properly picking up a Java project that a current project was dependent on.

You can go to Project > BuildPath > Configure BuildPath and then delete and re-add the project.

Right-click your project and go to Properties > Java Build Path > Source.

Make sure your source directory (for example MyProject/src) is listed as a Source folder. Otherwise you won't get any red markers.

There are obviously several reasons why this might occur, and I thought I'd add the solution to my issue. (I have a java project into which I have imported files with virtual links)

If you have a situation like mine, you will have another folder on the same level as your 'src' folder. If you do, right-click on that other folder, then select 'Build Path' > 'Add to Build Path' (if you see 'Build Path' > 'Remove from Build Path', then it had already been added.)

To further configure the Build Path, right click on your top level project dir, and select 'Build Path' > 'Configure Build Path'. Your folders should show up in the 'Source' tab.

To configure what errors you see, Click on Java Compiler > Errors/Warnings and then click 'Configure Workspace Settings'. That is the same as going to Window > Preferences > Java > Compiler > Errors/Warnings. If you don't want Eclipse to ignore something, then just change it to Warning.

This is not totally an answer to your question, but is related. I thought eclipse stopped showing red/yellow flags next to files in my project. The solution was very simple - I was looking at the Navigator tab (which doesn't show error/warning flags) instead of the Package Explorer tab.

enter image description here

If "Debug" has been recently activated then check the top right of the program (under the Minimise button) and click back onto Java.

  1. Check your source directory is listed in source folder of project

    • Right-click your project > Build Path > Configure Build Path > Source.
  2. If you are using multiple projects (as dependencies)

    • Project->Clean...,

      enter image description here
  3. Check "Build Automatically" is enabled or not.



    • enter image description here

In my case I setted a old workspace and it was the problem.

Try to set a new folder for workspace

I experienced that problem with a MapReduce project. I closed the error window and never came back after doing what the other answers suggested.

Click on the bottom left -> Other -> Problems

enter image description here

Kepler SP2, Java Project (Web Driver), and we use Gradle instead of Maven

None of the above helped, what did fix the problem for me was to select my projects (r-Click) > Gradle > Refresh All

Pointing the source(src) folder to the build path will solve this easily to do so right click on the project > build path > configure build path > java build path > source > add folder and click Apply

enter image description here

Try following:

  1. Open Problems window (Windows -> Show View -> Problems)

  2. Right click on the error and then Quick Fix

This procedure helped me solve the same problem.

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

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

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.

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

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.