Eclipse Web lib configuration

eclipse48Eclipse has used different configuration steps to add libraries to Web applications. This tutorial shows how to configure them with Eclipse Galileo, Helios and Indigos.

 

 

When using Galileo (or earlier) Eclipse releases, exporting libraries to the WEB-INF/lib folder of your Web application could be done by means of the Java EE Module dependencies option. Right click on your project and select “Java EE Module dependencies

 

eclipse jboss deploy

When using Helios or Indigo you can use a more fine-grained approach which let you add libraries from a the build path or from a static location even from other projects.

Right-click on the project Properties and select “Deployment Assembly“.

assembly deployment eclipse

From there, choosing the “Java Build Path Entries” option will automatically export your Build Path into the WEB-INF/lib folder of your web application.

assembly eclipse deploy lib

Alternative approaches:

1) Enable the “Problems” view. You will see that libraries added to the build path, but not exported are marked as a warning. Right-click on the library and choose “Quick fix

eclipse helios libs web-inf/lib

then “Mark the associated raw classpath as entry …..”

eclipse helios libs web-inf/lib

2) At last, you can manually copy/drag your libraries in the WEB-INF/lib folder of your Project Explorer and they will be automatically exported in the same location in your war.

web3

Found the article helpful? if so please follow us on Socials