I have a project that requires some Tomcat libs to run properly. I installed Tomcat (on Mac) which is essentially just a put-the-folder-somewhere process. I originally resolved the issue by adding the needed jar files as external jars for the project - however this messes with the project .classpath
which I can't allow - those changes would be tracked in our source control.
I've tried adding the tomcat/lib
directory to eclipse as a classpath variable but that doesn't resolve the issue.
When the tomcat server starts, I receive ClassNotFoundException: HttpServletRequest
.
How else can I add the tomcat lib directory so that I'm not modifying the project classpath?
You can install Webtools plugin (installed by default in Eclipse for JavaEE Developers) and then you will get Tomcat runtime support. Then you can add a "Tomcat Runtime" to your project and it will automatically include all Tomcat jars that are available to webapps running on Tomcat.
Window > Preferences > Server > Runtime environments
select your runtime you created
This process will also modify your .classpath
file but it will do so in a way that is easy to share with other developers.
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