Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web App Libraries empty in Eclipse - no "jars" found

Recently my Spring MVC Java app, developed in Eclipse Indigo, seemed to lose it's connection to my "lib" folder where all my jars are (there were no jars found for my project anymore).

How do I fix this?

like image 687
Brad Parks Avatar asked Jun 08 '12 14:06

Brad Parks


People also ask

How do I fix missing required library in Eclipse?

Close and re-open the project without closing eclipse, this might rebuild Eclipse resource cache. Make a clean build after re-opening. Re-import your project into a clean workspace.

Why referenced libraries Eclipse not showing?

Why referenced Libraries Eclipse not showing? First, bring up the "Package Explorer" view (instead of the "Project Explorer" view). Then, if the referenced . jar files still are visible in the root of the project, click on the little "down arrow" icon in the top-right corner of the Package Explorer view.

How do I enable libraries in Eclipse?

To get started, open the "Preferences" window in Eclipse. Navigate to "Java » Build Path » User Libraries" on the left-hand side and click the "New" button. Enter the library name and click the "OK" button (leave the "System library" checkbox alone).


2 Answers

For me, Brad Parks's answer didn't worked in Eclipse Luna ( 4.4.2 ) i.e. Adding Web App Libraries had no effect ..that remained empty.

What I had to is to configure Web Deployment Assembly ...My lib was in WEB-INF which was again like - /{project}/web/WEB-INF/lib and when I added a Deployment Assembly entry like shown below ,

enter image description here

Then below these two I had an entry for every jar from {project}/web/WEB-INF/lib directory with Deploy Path as WEB-INF/lib.

This Deployment Assembly automatically populated my Web App Libraries.

like image 184
Sabir Khan Avatar answered Sep 29 '22 11:09

Sabir Khan


For me, the fix was simple:

  • Go here in the Eclipse menu: Project | Properties | Project Facets
  • Ensure "Java" and "Dynamic Web Project" are selected
  • Click OK

You may need to also do this:

  • Go here in the Eclipse menu: Project | Properties | Java Build Path | Libraries
  • Remove "Web App Libraries"
  • Click "Add Library"
  • Choose "Web App Library". Click "Next"
  • Choose your project in the drop down
  • Click OK
like image 33
Brad Parks Avatar answered Sep 29 '22 11:09

Brad Parks