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

buildpatheclipsejava

I have been given a source folder (src) of a Java Project. I have created a .project file, kept it inside that folder and imported that project into Eclipse 3.6 through the Import Existing Projects into Workspace Option and added the required jars to it.

Now the problem is that when ever I do a Call Hierarchy on a Project, it displays an alert box saying
"The resource is not on the build path of a java project"

Could somebody please let me know how to resolve this?

Please see the image here:

enter image description here

Thanks

Best Answer

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