SLF4J: Class path contains multiple SLF4J bindings报错,logback-classic.jar与slf4j-log4j12.jar包冲突如何解决?

目录

1.问题

2.原因

3.解决办法


1.问题:

控制台一直报错:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/logback-classic/1.1.11/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
2.原因:

这个是maven依赖引入的logback-classic.jar包与slf4j-log4j12.jar包发生冲突,jdk不知道该用哪一个包

SLF4J: Class path contains multiple SLF4J bindings报错,logback-classic.jar与slf4j-log4j12.jar包冲突如何解决?_第1张图片

3.解决办法:

手动删除一个包,推荐删除slf4j-log4j12.jar

右键pom.xml,点击Analyze Dependencies - 搜索找到slf4j-log4j12.jar,右键Go to Maven Dependency,打开所在依赖的pom文件

SLF4J: Class path contains multiple SLF4J bindings报错,logback-classic.jar与slf4j-log4j12.jar包冲突如何解决?_第2张图片

你可能感兴趣的:(logback,java,intellij-idea)