gpt4 book ai didi

java - 如何解决 java.lang.NoClassDefFoundError : org/slf4j/LoggerFactory?

转载 作者:行者123 更新时间:2023-12-02 05:46:44 25 4
gpt4 key购买 nike

我尝试在 IDE 之外运行我的项目,但收到 java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

它在 IDE 中工作正常,但当尝试从批处理文件运行它时,它会加载应用程序面板并抛出此错误。

我已将所有库包含在批处理文件中,所有库都存在,并且它们与 IDE 内部使用的库相同。

java -cp bin;deps/InetAddressLocator.jar;deps/lombok.jar;deps/commons-collections4-4.0.jar;deps/mina-core-1.1.7.jar;deps/mysql.jar;deps/slf4j-api-1.6.1;deps/slf4j-simple-1.6.1.jar; game.engine.GameEngine true 0 0
pause

我该如何解决这个问题?

[02/06/2014 12:42:52 AM]: Exception in thread "main" 
[02/06/2014 12:42:52 AM]: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
[02/06/2014 12:42:52 AM]: at org.apache.mina.util.NamePreservingRunnable.<init>(NamePreservingRunnable.java:32)
[02/06/2014 12:42:52 AM]: at org.apache.mina.transport.socket.nio.SocketAcceptor.startupWorker(SocketAcceptor.java:165)
[02/06/2014 12:42:52 AM]: at org.apache.mina.transport.socket.nio.SocketAcceptor.bind(SocketAcceptor.java:141)
[02/06/2014 12:42:52 AM]: at game.engine.GameEngine.main(GameEngine.java:125)
[02/06/2014 12:42:52 AM]: Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
[02/06/2014 12:42:52 AM]: at java.net.URLClassLoader$1.run(Unknown Source)
[02/06/2014 12:42:52 AM]: at java.net.URLClassLoader$1.run(Unknown Source)
[02/06/2014 12:42:52 AM]: at java.security.AccessController.doPrivileged(Native Method)
[02/06/2014 12:42:52 AM]: at java.net.URLClassLoader.findClass(Unknown Source)
[02/06/2014 12:42:52 AM]: at java.lang.ClassLoader.loadClass(Unknown Source)
[02/06/2014 12:42:52 AM]: at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
[02/06/2014 12:42:52 AM]: at java.lang.ClassLoader.loadClass(Unknown Source)
[02/06/2014 12:42:52 AM]: ... 4 more

最佳答案

java -cp bin;deps/InetAddressLocator.jar;deps/lombok.jar;deps/commons-collections4-4.0.jar;deps/mina-core-1.1.7.jar;deps/mysql.jar;deps/slf4j-api-1.6.1;deps/slf4j-simple-1.6.1.jar; game.engine.GameEngine true 0 0

slf4j-api-1.6.1 末尾缺少“.jar”。它应该读作“slf4j-api-1.6.1.jar”

关于java - 如何解决 java.lang.NoClassDefFoundError : org/slf4j/LoggerFactory?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23985986/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com