SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". error
Solution 1:
I can also confirm this error.
Workaround: is to use external maven inside m2eclipse, instead of it's embedded maven.
That is done in three steps:
1 Install maven on local machine (the test-machine was Ubuntu 10.10)
mvn --version
Apache Maven 2.2.1 (rdebian-4) Java version: 1.6.0_20 Java home: /usr/lib/jvm/java-6-openjdk/jre Default locale: de_DE, platform encoding: UTF-8 OS name: "linux" version: "2.6.35-32-generic" arch: "amd64" Family: "unix"
2 Run maven externally link how to run maven from console
> cd path-to-pom.xml > mvn test
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Simple
[INFO] task-segment: [test]
[INFO] ------------------------------------------------------------------------
[...]
[INFO] Surefire report directory: [...]/workspace/Simple/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running net.tverrbjelke.experiment.MainAppTest
Hello World
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.042 sec
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[...]
3 inside m2eclipse: switch from embedded maven to local maven
- find out where local maven home installation dir is (
mvn --version
, or google for yourMAVEN_HOME
, for me this helped me that is/usr/share/maven2
) - in eclipse Menu->Window->Preferences->Maven->Installation-> enter that string. Then you should have switched to your new external maven.
- then run your Project as e.g. "maven test".
The error-message should be gone.
Solution 2:
There is a documentation in SLf4J site to resolve this. I followed that and added slf4j-simple-1.6.1.jar to my aplication along with slf4j-api-1.6.1.jar which i already had.This solved my problem
slf4j
Solution 3:
If you are using Gradle add this:
dependencies {
...
compile "org.slf4j:slf4j-simple:1.7.9"
...
}
Solution 4:
Had similar error with the same result with Gradle and was able to solve it by following:
//compile 'org.slf4j:slf4j-api:1.7.1'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.1'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.1'
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.1'
Out-commented line is the one which caused the error output. I believe you can transfer this to Maven.