Question

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.

Was it helpful?

Solution

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:

Note that SLF4J-enabling your library/application implies the addition of only a single mandatory dependency, namely slf4j-api-1.6.1.jar.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top