日期:2014-05-20  浏览次数:20958 次

myeclipse控制台程序运行报错:could not find the main class:org.apache.log4j.net.JMSSink.
如题,已经检查了jdk,jre版本一致,都是6.0,类里有main方法。开始是类文件名大写能成功,小写报错,现在不管大小写都出错,运行以前建的同样的控制台程序没问题。同时控制台那里错误信息提示:
java.lang.NoClassDefFoundError: javax/jms/MessageListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Caused by: java.lang.ClassNotFoundException: javax.jms.MessageListener
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 12 more
Exception in thread "main" 

不好意思,本人分不多,只能给这么多了,求大神帮帮忙!谢谢啦!

------解决方案--------------------
把你写的程序贴上来