可能重复:
SLF4J: Failed to load class org.slf4j.impl.StaticLoggerBinder error日食 - 无法加载类 “org.slf4j.impl.StaticLoggerBinder”
我使用日食JUNO使用运行某人的其他Java代码maven(m2eclipse插件)。但我得到以下信息:
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.
在official website,我发现这个问题,以下修补程序:
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.
所以我复制SLF4J-simple.jar在“C:\ Program Files文件\ Java \ jdk1.7.0_07 \ lib“。但我仍然有错误。
请指导我什么是正确的解决方案。我是一个Java新手。
也可以有人请提一下究竟应该是什么值为JAVA_HOME
,CLASSPATH
和CLASS
变量。我很困惑它是否应该是jre
或jdk
或任何路径?
UPDATE:
以下为slf4j
依赖是否有项目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>
我已经更新了我的项目。 slf4j-api-1.5.6.jar
和slf4j-simple-1.5.6.jar
显示在“Maven dependencies”在我的项目中。并且org.slf4j.impl.StaticLoggerBinder.class
也存在于slf4j-simple-1.5.6.jar
在mvn clean install过程中发生了什么? –
只需添加一个依赖到pom.xml中: < - 语言:郎XML - > org.slf4j SLF4J-log4j12 1.6.1 –
cane