Using .jar file in Tomcat Server

爷,独闯天下 提交于 2019-12-12 04:22:02

问题


I'm trying to use colt.jar file into my project in Tomcat Server. I have tried to put it into WEB-INF/lib/ , /lib even also in MyProject/lib/. none of them are working. Previously, I have used jar files like Jama-1.0.2.jar or servlet-api.jar and they were working pretty fine. I have tried to use it in my local machine importing the jar file with Eclipse, it works fine. But no idea why not working on the Server side.

Any suggestion please?

ADDED LATER :::: I have added the classpath and then during compilation it did not give me any error. But eventually during runtime, the methods (included to that class) are not working. It's not giving any error. It simply does not proceed with the execution. Need Help :(


回答1:


It seems like you are confused between two different things:

  1. Having the jar on your classpath when compiling your own classes.
  2. Having the jar available at runtime

If you use Eclipse for Java EE developers (see http://www.eclipse.org/downloads/) and create a dynamic web project instead of a regular java project, then jars placed into WEB-INF/lib will automatically be added to the classpath for compilation, and will also be added to the WAR archive that will be deployed to Tomcat.



来源:https://stackoverflow.com/questions/6364770/using-jar-file-in-tomcat-server

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