开发者

Error with org.slf4j.Logger

I have an error when I import the org.slf4j.* packages.

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Do you have any idea开发者_运维问答s where it came from ?


You must include JARs in your classpath. I'd suggest the following:

  • slf4j-api-1.7.7.jar
  • slf4j-simple-1.7.7.jar

They can be found on: http://www.slf4j.org/download.html


You should take a look at SL4J (Simple Logging Facade for Java). Hope this helps.


You either have manually organized imports, or asked Eclipse to do so every time you save your Java file.

This function expands *-imports to the individual classes needed. This helps avoiding ambiguity.


At this situation, you can to add dependencies to org.slf4j.* packages, I think so. For example for Gradle:

compile 'log4j:log4j:1.2.17' compile 'org.slf4j:slf4j-api:1.7.5' compile 'org.slf4j:slf4j-log4j12:1.7.5'

More details here Gradle does not find dependencies

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜