user1954970
user1954970

Reputation: 409

The resource is not on the build path of a java project?

I have a Maven project on my Eclipse. When I perform call hierarchy I get the message:

The resource is not on the build path of a java project.

What needs to be configured for this?

Upvotes: 9

Views: 30680

Answers (4)

user1455310
user1455310

Reputation:

Since you are working on a Maven project, every resource must be included in a pom.xml file. If not, the external file must be included as a jar file. Also, if you are not able to open the call hierarchy, the project which is being referred must be open in your Eclipse workspace.

Upvotes: 0

Gab
Gab

Reputation: 8323

Assuming you're expecting a call hierarchy in your own code, ensure that all sources are located in the src/main/java directory.

Have you installed the Eclipse m2e plugin? Does your Eclipse recognize the project as a Maven project? (right click > maven > convert to maven project)

Upvotes: 2

nomail
nomail

Reputation: 11

I have this quite often. Seems bug in Eclipse. Quit/restart Eclipse seems the easiest to get things working again.

Upvotes: 1

user1954970
user1954970

Reputation: 409

I followed the following steps it worked:

  1. Properties->project facets->check java->ok
  2. convert to maven project.

Upvotes: 13

Related Questions