问题描述
我已经将一个现有项目导入到Eclipse IDE中。我观察到的是,应用程序本身有一些jar(例如,这些jar是ehcache-core-2.4.1.jar,cxf-2.2.3.jar,wss4j-1.5.8和更多)
我们使用java Buld路径 - > Libraries --->添加外部Jars手动添加到Eclipse中的某些jar。
请告诉我,什么罐子应该是应用程序的一部分,我们需要使用添加外部Jars选项手动添加哪些jar?
非常感谢。
这里提到的问题本质上是主观的,它需要一个更清晰的上下文来获得更清楚的答案。但是,我将尝试为您的查询提供答案。
当您知道应用程序jar的环境将在eclipse选项中使用添加外部Jars在应用程序运行时,将运行jvm类路径中的jar文件(通过外部jar选项添加)。如果您认为JVM不会在其类路径中具有代码依赖性的类,那么这些类(可能在jar或文件夹中)应该是应用程序的一部分。如果您的应用程序是可执行的Jar文件,那么您应该有清单文件(请参阅)提到你有依赖关系的jar文件的路径。
在eclipse中添加jar文件(只需要做Add Jars或Add External Jars)只适用于eclipse中的项目编译。
I have imported an existing Project into Eclipse IDE .What i observed is that , there are some jars that comes with the Application itself ( For example those jars are ehcache-core-2.4.1.jar , cxf-2.2.3.jar , wss4j-1.5.8 and many more)And some jars we manually added into Eclipse using java Buld path --> Libraries --->Add External Jars .
Please tell me , what jars should be part of the Application and what jars we need to manually add using Add External Jars Option ??
Thank you very much .
The question being asked here is bit subjective in nature and it needs a bit more clear context to get clearer answer. However I will make an attempt to provide answer to your query.
You use "Add External Jars" in eclipse option when you know that the environment in which your application jar will be run will have those jar files (added via external jars option) in the classpath of jvm at runtime of application. In case you think that JVM is not going to have the classes in its classpath on which your code has dependency then those classes (may be inside a jar or a folder) should the part of your application. If your application is an executable Jar file then you should have manifest file (see http://en.wikipedia.org/wiki/Manifest_file) mentioning the path to the jar files you have dependency.Adding jar files in eclipse (by just doing "Add Jars" or "Add External Jars") is only meant for your project compilation in eclipse.
这篇关于包括项目中需要的罐子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!