I'm using Eclipse and I need to be able to add Java libraries (JAR files) into my web application's WEB-INF/lib
folder. How do I achieve this?
Right-click your project in Eclipse, and go to "Build Path > Configure Build Path" Add the "Web App Libraries" library This will ensure all WEB-INF/lib jars are included on the classpath.
However, the 'add external jars' button is greyed out, implying that i am not allowed to use it. Can anyone help? If your project builds with Java 9+ make sure you've selected Classpath (as shown here). You should also be able to add the JAR with right-click on the project > Build Path > Add External Archives....
9 Answers. Show activity on this post. If you're wanting to include a JAR file to your Eclipse project, you would generally create a 'lib' folder inside the project folder, and put the file in there. You then need to tell eclipse to include it in your class path so your code will compile and run inside eclipse.
This will ensure all WEB-INF/lib jars are included on the classpath.
Found a solution. This problem happens, when you import a project.
The solution is simple
Now you should see the web app libraries showing your jars added.
Pasting the jar files in WebContent\WEB-INF\lib via the file system was the only way it worked for me.
They then appeared under the Deployed Resources and WebContent lib sub-folders.
When I looked, the build path had the jars in the Web App Libraries and everything built and ran fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With