我有一个通过logback-classic-1.2.3+logback-core-1.2.3+slf4j-api-1.7.25.jar记录的java项目。它在eclipse中成功运行。但是将项目转换为jar,它有一些问题。以下是错误消息:
Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/classic/LoggerContext
at com.wang.log.LogManager.<clinit>(LogManager.java:35)
at com.wang.startup.StartUp.<clinit>(StartUp.java:10)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.classic.LoggerContext
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 2 more
I guess the error code is happen in this:
```LoggerContext logbackContext = (LoggerContext) LoggerFactory.getILoggerFactory();```
但我真的不知道为什么,谢谢你的回答。
暂无答案!
目前还没有任何答案,快来回答吧!