Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse - Failed to load class "org.slf4j.impl.StaticLoggerBinder" [duplicate]

Possible Duplicate:
SLF4J: Failed to load class org.slf4j.impl.StaticLoggerBinder error

I am using eclipse juno to run someone's else Java code using maven(m2eclipse plugin). But I am getting following message:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 

On the official website, I found the following fix for this problem:

This error is reported when the org.slf4j.impl.StaticLoggerBinder class could not be loaded into memory.  This happens when no appropriate SLF4J binding could be found on the class path.  Placing one (and only one) of slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem. 

So I copied slf4j-simple.jar in "C:\Program Files\Java\jdk1.7.0_07\lib". But I am still getting error.

Please guide me what is correct solution. I am a Java newbie.

Also can someone please mention what exactly should be the value for JAVA_HOME, CLASSPATH and CLASS variables. I am confused whether it should be path of jre or jdk or any?

UPDATE:

Following dependency for slf4j are there in project pom.xml.

<dependency>            <groupId>org.slf4j</groupId>            <artifactId>slf4j-api</artifactId>            <version>1.5.6</version>            <type>jar</type> </dependency> <dependency>            <groupId>org.slf4j</groupId>            <artifactId>slf4j-simple</artifactId>            <version>1.5.6</version> </dependency> 

I have updated my project. Also the slf4j-api-1.5.6.jar and slf4j-simple-1.5.6.jar are showing up in "Maven dependencies" in my project. And org.slf4j.impl.StaticLoggerBinder.class is also present in slf4j-simple-1.5.6.jar

like image 803
amitsharma Avatar asked Nov 20 '12 13:11

amitsharma


1 Answers

Eclipse Juno, Indigo and Kepler when using the bundled maven version(m2e), are not suppressing the message SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". This behaviour is present from the m2e version 1.1.0.20120530-0009 and onwards.

Although, this is indicated as an error your logs will be saved normally. The highlighted error will still be present until there is a fix of this bug. More about this in the m2e support site.

The current available solution is to use an external maven version rather than the bundled version of Eclipse. You can find about this solution and more details regarding this bug in the question below which i believe describes the same problem you are facing.

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". error

like image 113
Konstantinos Margaritis Avatar answered Sep 25 '22 07:09

Konstantinos Margaritis