当我在终端上运行命令./runExamples.sh
时,它会抛出异常。我已经检查过安装了Java并且已经设置了类路径。如何解决这个问题?
Starting examples app with java from environment variable PATH...
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.optaplanner.examples.common.app.CommonApp.<clinit>(CommonApp.java:36)
at org.optaplanner.examples.app.OptaPlannerExamplesApp.main(OptaPlannerExamplesApp.java:72)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 2 more
答案 0 :(得分:0)
您错过了类路径中的slf4j.jar
。下载并添加它。