与 slf4j 库相关的编译问题
我正在尝试编译一个开源库,并遇到以下问题。当我保留slf4j-jcl-1.6.0.jar和slf4j-api-1.6.0.jar这两个库时,eclipse编译器会给我以下错误消息:
SLF4J:类路径包含多个 SLF4J 绑定。 SLF4J:在 [jar:file:/home/hengs6/mahout/mahout-distribution-0.5/mahout-examples-0.5-job.jar!/org/slf4j/impl/StaticLoggerBinder.class] 中找到绑定 SLF4J:在 [jar:file:/home/hengs6/mahout/mahout-distribution-0.5/lib/slf4j-jcl-1.6.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] 中找到绑定
如果我删除这些两个库,那么编译器会给我以下错误消息:
2011 年 6 月 15 日下午 2:51:12 org.slf4j.impl.JCLLoggerAdapter 错误
如何解决这个问题?谢谢。
I am trying to compile an open source library, and meet the following problem. When I keep the two libraries, slf4j-jcl-1.6.0.jar and slf4j-api-1.6.0.jar, the eclipse compiler will give me the following error messages:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/chengs6/mahout/mahout-distribution-0.5/mahout-examples-0.5-job.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/chengs6/mahout/mahout-distribution-0.5/lib/slf4j-jcl-1.6.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
If I remove these two libraries, then the compiler will give me the following error messages:
Jun 15, 2011 2:51:12 PM org.slf4j.impl.JCLLoggerAdapter error
How to solve this issue? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SLF4J 仅要求您在类路径中拥有
slf4j-api-1.6.0.jar
和记录器实现之一。 手册是这样说的:就您而言,我猜您的类路径中有多个记录器实现。在我看来,
mahout-examples-0.5-job.jar
已经包含了一些 SLF4J 实现类。SLF4J only requires you to have
slf4j-api-1.6.0.jar
and one of the logger implementations in your classpath. This is what the manual says:In your case I'd guess you have multiple logger implementations in your classpath. It looks to me like
mahout-examples-0.5-job.jar
already includes some SLF4J implementation classes.