Compiling the slf4j library problem

I am trying to compile an open source library and perform the following task. When I store 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: the class path contains several SLF4J bindings. SLF4J: found the binding in [jar: file: /home/chengs6/mahout/mahout-distribution-0.5/mahout-examples-0.5-job.jar! /Org/slf4j/impl/StaticLoggerBinder.class] SLF4J: found the 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:

June 15, 2011 2:51:12 org.slf4j.impl.JCLLoggerAdapter error

How to solve this problem? Thank.

+3
source share
1 answer

SLF4J requires only slf4j-api-1.6.0.jarone of the log implementations in your class path. This is what manual says:

Please note that SLF4J - library / application implies adding only one required dependency, namely slf4j-api-1.6.1.jar.

In your case, I would suggest that several implementations of the journal are in your classpath . It seems to me that it mahout-examples-0.5-job.jaralready includes some implementation classes of SLF4J.

+2
source

All Articles