Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project is missing required library - but correct JAR exists?

Tags:

java

eclipse

One of my eclipse projects gives me the Project X is missing required library: 'somelib.jar' error, but when I go to Configure Build Path > Libraries the library is present, and no error is indicated there.

I tried the usual things:

  • Clean build (all projects in the workspace)
  • Exited eclipse multiple times

My coworkers, using the same git checkout with the same status as mine, and also using eclipse Neon2, have no build errors.

Just to be sure, I navigated into the corresponding directory and removed a different jar file, and when I look at my build path configuration that jar shows up with a red "x" indicating that the library is missing.

I checked that somelib.jar sits in the expected place and is a valid JAR file.

How do I fix this?

like image 407
GhostCat Avatar asked Jan 03 '23 11:01

GhostCat


1 Answers

These steps did resolve the problem:

  • closing / re-opening the corresponding project
  • another "full" clean of all projects in the workspace

In other words: it seems that a simple F5 "refresh" and a even a "clean project" isn't sufficient sometimes. So closing the project is the key element here!

like image 73
GhostCat Avatar answered Jan 06 '23 02:01

GhostCat