ami*_*rma 42 java eclipse maven
我正在使用eclipse juno使用maven(m2eclipse插件)运行某人的其他Java代码.但我收到以下信息:
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.
Run Code Online (Sandbox Code Playgroud)
在官方网站上,我发现了以下针对此问题的修复:
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.
Run Code Online (Sandbox Code Playgroud)
所以我在"C:\ Program Files\Java\jdk1.7.0_07\lib"中复制了slf4j-simple.jar .但我仍然得到错误.
请指导我什么是正确的解决方案.我是一个Java新手.
也有人可以请注明究竟应该是值JAVA_HOME,CLASSPATH和CLASS变量.我很困惑是否应该路径jre或jdk或任何?
更新:
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>
Run Code Online (Sandbox Code Playgroud)
我已经更新了我的项目.另外,slf4j-api-1.5.6.jar和slf4j-simple-1.5.6.jar正展现在"Maven依赖"在我的项目.并且org.slf4j.impl.StaticLoggerBinder.class也存在于slf4j-simple-1.5.6.jar
Kon*_*tis 38
使用捆绑的maven版本(m2e)时,Eclipse Juno,Indigo和Kepler不会抑制消息SLF4J:无法加载类"org.slf4j.impl.StaticLoggerBinder".此行为存在于m2e版本1.1.0.20120530-0009及之后.
虽然,这表示为错误,您的日志将正常保存.在修复此错误之前,突出显示的错误仍然存在.有关m2e支持网站的更多信息.
当前可用的解决方案是使用外部maven版本而不是捆绑的Eclipse版本.您可以在下面的问题中找到有关此错误的此解决方案和更多详细信息,我相信这些错误描述了您所面临的同一问题.
SLF4J:无法加载类"org.slf4j.impl.StaticLoggerBinder".错误
Ale*_*lov 10
您是否更新了项目(右键单击项目,"Maven">"更新项目......")?否则,您需要检查是否pom.xml包含必要的slf4j依赖项,例如:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
152881 次 |
| 最近记录: |