Eclipse运行出现“A Java Exception has occured”
具体的报错信息为:
Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
at org.apache.catalina.util.LifecycleBase.(LifecycleBase.java:39)
Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
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)
… 1 more
今天只是想运行下以前的程序,结果main函数报错,弄了半天也没弄好,最终发现问题非常简单:
只要右击项目 -> Run As -> Java Application 即可
因为之前运行过web project,系统默认为Run As -> Server,只要改过来即可。
是不是发现很傻……