Eclipse is not showing compilation errors in project explorer

Have you checked Project/Build Automatically?


I had the same problem. I checked the .classpath file of the Eclipse project. It had incorrect value of src so it was pointing to the wrong source of Java files.

My file's incorrect entry:

<classpathentry kind="src" path="src"/>

I changed it to the correct entry:

<classpathentry kind="src" path="source/java"/>

Now, its working :)


As I can see in your project explorer there is a RED exclamation mark over your project name which means there is a problem with the build path in your project. See here for more details.

Check the Build Path of the project by right-clicking the project and selecting Build Path -> Configure Build Path. One problem I often encountered is different people using different Java SDK and so when the exact SDK is not available on your machine, you need to change to your Java SDK (via JRE System Library -> Alternate JRE). A better way to avoid this problem is to always select the JRE System Library from Workspace default JRE or Execution Environment.

Tags:

Java

Eclipse