Preethi Jain Preethi Jain - 9 months ago 168
Java Question

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

I have been given a Source Folder (

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

Now the Problem is that when ever i do a Call Hierarchy on a Project , It displays a Alert box Saying
"The resource is not on the build path of a java project"

Could anybody please let me know how to resolve this ?

Please see the image here

enter image description here



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