Including java libraries to Tomcat inside Eclipse

送分小仙女□ 提交于 2020-01-02 05:13:32

问题


I am running Eclipse with Tomcat 5.5.

My dynamic web site project includes some JAVA code that needs external jar files. Where should I place those jar files so Apache will not giving me errors such as java.lang.ClassNotFoundException ?

Thanks on this.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/2890183/including-java-libraries-to-tomcat-inside-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!