在Tomcat服务器中使用.jar文件 [英] Using .jar file in Tomcat Server

查看:363
本文介绍了在Tomcat服务器中使用.jar文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 colt.jar 文件用于Tomcat Server中的项目。我试过把它放到WEB-INF / lib /,/ lib中,甚至也放在MyProject / lib /中。他们都没有工作。以前,我使用过像Jama-1.0.2.jar或servlet-api.jar这样的jar文件,它们工作得很好。我试图在我的本地机器上用Eclipse导入jar文件,它工作正常。但不知道为什么不在服务器端工作。

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.

有任何建议吗?

后来添加::: :我已经添加了类路径,然后在编译期间它没有给我任何错误。但最终在运行时,方法(包含在该类中)不起作用。它没有给出任何错误。它只是不继续执行。需要帮助:(

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 :(

推荐答案

您似乎对两种不同的东西感到困惑:

It seems like you are confused between two different things:


  1. 在编译自己的类时将jar放在类路径上。

  2. 在运行时使用jar

如果您将Eclipse用于Java EE开发人员(请参阅 http: //www.eclipse.org/downloads/ )并创建一个动态Web项目而不是常规的java项目,然后放入WEB-INF / lib的jar将自动添加到类路径进行编译,并且还会被添加到将部署到Tomcat的WAR存档中。

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.

这篇关于在Tomcat服务器中使用.jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆