score:-2

if "debug" has been recently activated then check the top right of the program (under the minimise button) and click back onto java.

score:-1

in my case i setted a old workspace and it was the problem.

try to set a new folder for workspace

score:0

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

score:0

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.

score:0

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

score:0

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

score:0

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

score:0

my mistake was that i was creating classes in resource package...

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

score:0

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

score:0

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.

score:0

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.

score:1

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.

score:1

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.

score:1

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.

score:1

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

score:1

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

score:2

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.

score:2

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.

score:2

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.

score:3

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.

score:3

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

score:4

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.

score:11

  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.

    • project > build automatically

      enter image description here

score:12

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>

score:15

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

score:41

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 )

score:43

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.

score:51

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.


Related Query

More Query from same tag