Reputation: 6624
I keep getting the error :
SLF4J: Class path contains multiple SLF4J bindings.
in all my projects, even after deleting and starting a fresh new project
File > New > Plug-in Development > Plug-in Project
What could be the problem?
I have tried removing the C:\Users\Username\.m2
, even though this is not a Maven project, but to no avail.
Eclipse
Eclipse Java EE IDE for Web Developers.
Version: Mars.1 Release (4.5.1)
Build id: 20150924-1200
Java
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)
Upvotes: 2
Views: 5842
Reputation: 2617
SLF4J is split into two main JARs. Apart from the API you have a binding, which is an implementation of the API for a particular logging framework (like log4j, logback, commons-logging etc). SLF4J will warn you if you have two bindings in a classpath, because the one that ends on the classpath first will be used, while the other will have no effect. The warning is there because it is quite easy to include many bindings, either through Maven transitive dependencies or by depending on plugins that use different slf bindings (if this is Eclipse pligin).
Check you effective dependencies for the following files: slf4j-simple-xxx.jar
, slf4j-log4j12-xxx.jar
, slf4j-jdk14-xxx.jar
, slf4j-jcl-xxx.jar
, slf4j-nop-xxx.jar
and logback-classic-xxx.jar
. Exclude all but the one you want to actually use and the warning will go away.
Upvotes: 3