1
votes

After compiling my java code under Eclipse, I got the following error messages:

SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/user1/workspace/MC/lib/slf4j-nop-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/home/user1/workspace/stable/lib/org.slf4j/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]

t seems to me that the two slf4j*.jar files cause the conflict. I tried to remove one jar file from the built path. After clicking “build path->Configure build path”, selecting the “Libraries” tab, I could not find any library matching home/user1/workspace/stable/lib/org.slf4j/slf4j-log4j12-1.6.1.jar”

If there does not have this file, why it causes conflict?

1

1 Answers

1
votes

It could be possible that another jar on your buildpath contains a version of slf4j, which is different than the one you expect. Rearrange your Also, Per SLF4J docs, this should be a warning and not an error.

http://www.slf4j.org/codes.html

Note that the warning emitted by SLF4J is just that, a warning. SLF4J will still bind with the first framework it finds on the class path.

You should be able to put the SLF4J on top of your library ordering (Configure build path, Order and Export tab), so that you know it is using the version you expect it to. However, I would prefer finding where the conflict is and proceeding from there.