eclipse中执行maven报错Failedto load class org.slf4j.impl.StaticLoggerBinder?

来源:互联网 发布:java writer append 编辑:程序博客网 时间:2024/06/05 08:59

问题:

安装m2e后,将导入项目转化为maven project,仍有红色叉叉。

compile后,输出Failed to load class "org.slf4j.impl.StaticLoggerBinder".

                              SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. 


分析:http://www.slf4j.org/codes.html#StaticLoggerBinder

Failedto load class org.slf4j.impl.StaticLoggerBinder

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 orlogback-classic.jar on the class path should solve the problem.

since 1.6.0 As of SLF4J version 1.6, in the absence of a binding, SLF4J will default to a no-operation (NOP) logger implementation.

You can download SLF4J bindings from the project download page.


解决方法:

如上官方文档所述。

下载zip包,在properties->java build path -> libraries中add external JARS选择下载zip中的slf4j-nop.jar,slf4j-simple.jar,slf4j-log4j12.jar, slf4j-jdk14.jar orlogback-classic.jar任一。

红叉叉消失啦

0 0
原创粉丝点击