CodexBloom - Programming Q&A Platform

Eclipse 2023-09: how to to Load External .jar Files in a Dynamic Web Project

πŸ‘€ Views: 78 πŸ’¬ Answers: 1 πŸ“… Created: 2025-06-13
eclipse web-development java classpath maven Java

I'm working with an scenario with Eclipse 2023-09 where my dynamic web project is not recognizing external .jar files added to the build path. I've added the .jar files through the project properties and confirmed they are listed in the 'Java Build Path', but when I try to run the server, I get the following behavior: ``` java.lang.NoClassDefFoundError: org.apache.commons.lang3.StringUtils ``` I've tried the following steps: 1. Right-clicked on the project > Properties > Java Build Path > Libraries > Add External JARs, and selected the required .jar files. 2. Verified that these libraries appear under the 'Order and Export' tab and are checked. 3. Cleaned the project and rebuilt it. 4. Confirmed that the .jar files are not being excluded in the `WEB-INF/lib` directory, as I manually copied them there after the initial setup. 5. Restarted Eclipse and even recreated the server configuration in the Servers tab. Despite these efforts, the application fails to recognize the classes within the .jar files. I noticed that the build output does not include my external libraries. In my `pom.xml`, if I include dependencies with Maven, it works fine, but for this specific scenario where I want to use standalone .jar files, it isn't functioning as expected. Here’s a snippet of my `pom.xml` for reference: ```xml <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.12.0</version> </dependency> ``` Could someone guide to figure out why the .jar files are not being picked up by the server? Is there a specific configuration I'm missing or a common pitfall I should be aware of?