Martin
Martin

Reputation: 3753

Missing required library in eclipse for non-required library

I'm using Eclipse for Java Develepers (Juno x64 running on Windows 7).

I have a project in which I was trying out a jar I no longer need (args4j), so have removed the dependency. At some point, my PC lost power unexpectedly, and I've since restarted Eclipse.

My project now has an error, "Project 'MyProject' is missing required library: '/path/to/args4j-2.0.21.jar'". I was working with the project for some time after removing the dependency without any issues.

Under the Project Properties > Java Build Path, there's no reference to args4j in any of the tabs.

I've tried:

Does anyone have any idea why Eclipse is complaining, and what I might be able to do to fix it?

Upvotes: 44

Views: 95596

Answers (5)

Michael Wiles
Michael Wiles

Reputation: 21186

I've found that the easiest and simplest way is to switch to the navigator view, open the .factorypath file and delete the offending dependency.

Upvotes: 6

annu
annu

Reputation: 103

DO - mvn eclipse:clean eclipse:eclipse, on project and then refresh and then clean project , will solve this problem

Upvotes: 1

Brain
Brain

Reputation: 440

Deleting .classpath and .project, then reimporting the project as a Maven Project did work for me. It may also be useful to mark all Eclipse workfiles like .classpath in the p4ignore or gitignore from the beginning at the initial commit.

Upvotes: 4

Hakan Dilek
Hakan Dilek

Reputation: 2256

Please do the following, if one does not solve your problem, skip to the next one:

  1. Check .classpath file in your project folder. You might have a reference there.
  2. Close and re-open the project without closing eclipse, this might rebuild Eclipse resource cache.
  3. Make a clean build after re-opening.
  4. Re-import your project into a clean workspace.

Upvotes: 82

Martin
Martin

Reputation: 3753

Re-adding the problematic jar, then removing it did the trick. This is better than reconfiguring the entire workspace in my case, as I have many projects, and ADT configuration in my workspace.

Upvotes: 12

Related Questions