Eclipse: The resource is not on the build path of a Java project Eclipse: The resource is not on the build path of a Java project java java

Eclipse: The resource is not on the build path of a Java project


You can add the src folder to build path by:

  1. Select Java perspective.
  2. Right click on src folder.
  3. Select Build Path > Use a source folder.

And you are done. Hope this help.

EDIT: Refer to the Eclipse documentation


I am trying to set up a dynamic web project using Eclipse and its Maven plugin.I am selecting maven-archetype-webapp and am facing the same problem (which I run into when trying to automatically produce getters and setters for some attributes).

My way around this was to right-click on the project, select Build Path --> Configure Build Path and then remove a weird exclusion filter "Excluded:**" which I found under the entry /src/main/resources.


Recently I met a similar problem. When importing a project without a .project file, a default empty .project file was generated without builders. Here is an example .project to make it work.

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