T.D. Smith
T.D. Smith

Reputation: 994

How to find references to a class that's referenced indirectly via exported jar in Eclipse?

I have two Eclipse projects, Project_A and Project_B. Project_B is compiled and exported as a .jar file that's used by Project_A.

Is there a way to select a class in Project_B and find all references to it in both Project_A and Project_B?

Normally I'd use "Find all References" (Ctrl + Shift + G) for this, but it doesn't consider a reference via exported jar to be a "reference".

I know I can use a file search, but I'm hoping there's something more clever I can do.

Upvotes: 1

Views: 1290

Answers (2)

nitind
nitind

Reputation: 20003

For a plug-in project, all of its dependencies have to be from other plug-ins and declared using its MANIFEST.MF file. Being packaged in a .jar has nothing to do with it. At runtime, the stated dependencies are wired by Equinox. At development time, PDE uses your MANIFEST.MF to set up the project's Java Build Path allowing you to use the normal Java Search capabilities. In general, don't modify plug-in projects' Java Build Paths yourself.

Upvotes: 1

Jegg
Jegg

Reputation: 549

Try this:

  1. instead of compile and export project b as a jar, you just put it together with project a.
  2. right click on project a, select properties--Java Build Path, select "Projects" tab and then add project b to it

Then try do Ctrl + Shift + G

Don't blame me if it doesn't work :)

Upvotes: 0

Related Questions