开发者

Including java libraries to Tomcat inside Eclipse

开发者 https://www.devze.com 2022-12-31 22:12 出处:网络
I am running Eclipse with Tomcat 5.5. My dynamic web site project includes some JAVA code that needs extern开发者_JAVA百科al jar files. Where should I place those jar files so Apache will not giving

I am running Eclipse with Tomcat 5.5.

My dynamic web site project includes some JAVA code that needs extern开发者_JAVA百科al jar files. Where should I place those jar files so Apache will not giving me errors such as java.lang.ClassNotFoundException ?

Thanks on this.


Put them in the WEB-INF/lib of your web context, of course.

If there are JDBC driver JARs in your project, you'll need to add those to the Tomcat server /lib for Tomcat 7 and higher. Those should not be in your WEB-INF/lib.


Make sure that the jar you want to use(WebContent/WEB-INF/lib/yourjar) is visible in Eclipse. (Here)

When I used the windows file explorer to add the jdbc jar to my project it wasn't visible in Eclipse and the error ClassNotFoundException kept coming. However, dragging the jar into the Eclipse(UI) project did work for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消