Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compiling issue related to slf4j library

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.

like image 896
bit-question Avatar asked Jan 17 '26 00:01

bit-question


1 Answers

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.

like image 195
Benjamin Muschko Avatar answered Jan 19 '26 13:01

Benjamin Muschko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!