Java的依赖查找器Jini ClassDep的类路径问题 [英] Classpath problems with Jini ClassDep, Java's dependency finder

查看:102
本文介绍了Java的依赖查找器Jini ClassDep的类路径问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用Sun的 ClassDep 作为。好像在摇摆。但是,这头野兽很难驯服!

I started to use Sun's ClassDep as a solution to fight the inclusion of unnecessary JARs in my resulting WAR application. It seems to rock. However, this beast is hard to tame!

我遇到了一些找不到的类错误,即使它们明确地包含在我传递给它的类路径中。示例:

I'm getting several errors of classes not found even if they are explicitly included in the classpath I pass to it. Example:

couldn't find: org.apache.log4j.Logger: No file for: Logger
couldn't find: org.hibernate.Session: No file for: Session
couldn't find: org.joda.time.LocalDate: No file for: LocalDate

但是。 ..检查一下我给它的类路径:

HOWEVER... Check out a piece of the classpath I'm giving it:

...;"C:\Documents and Settings\Andre\Desktop\workspace\icaro\WebContent\WEB-INF\lib\hibernate3.jar";...;"C:\Documents and Settings\Andre\Desktop\workspace\icaro\WebContent\WEB-INF\lib\joda-time-1.5.2.jar";"C:\Documents and Settings\Andre\Desktop\workspace\icaro\WebContent\WEB-INF\lib\log4j-1.2.11.jar";...

我遍历了这些文件,发现那些文件中确实存在缺失类。

I went through those and saw that the "missing" classes are actually in those files.

任何人都知道给出了什么?

Anyone got any idea what gives?

推荐答案

这些条目可能在您引用的一个或多个JARS的清单文件中。清单文件条目被Classdep忽略,因此会给您带来错误。

Those entries are probably in the manifest files of one or more JARS that you reference. Manifest files entries are ignored by Classdep and so will give you errors.

请参见 ClassDep 文档:


如果使用JAR文件,则这些JAR文件中的所有类路径清单条目都会被忽略,因此您必须在路径中显式包括这些清单条目的值,否则可能会导致错误。例如,如果包含jini-ext.jar,则也应明确包含jini-core.jar,因为jini-core.jar位于jini-ext.jar的类路径清单条目中。

这篇关于Java的依赖查找器Jini ClassDep的类路径问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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