NoClassDefFoundError,有没有终极解决方案啊?

twht 2009-07-14 08:23:42
情况是:需要运行原来编译通过的CLASS,换了台电脑,把需要的CLASS也放在了文件夹里,CLASSPATH也设置了路径
但是运行时还是出现这样的错误?
为什么呢?


D:\c\com\apex\util\writer>java MainFrame
Exception in thread "main" java.lang.NoClassDefFoundError: MainFrame (wrong name
: com/apex/util/license/writer/MainFrame)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
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)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: MainFrame. Program will exit.
...全文
3711 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
twht 2009-07-14
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 keyboardsun 的回复:]
NoClassDefFoundError 是类加载失败。这个没有终极解决办法。类是找到的,就是加载出问题,出问题的可能很多。
[/Quote]

能列举出具体的问题点吗?
johnston678 2009-07-14
  • 打赏
  • 举报
回复
学习下...
keyboardsun 2009-07-14
  • 打赏
  • 举报
回复
NoClassDefFoundError 是类加载失败。这个没有终极解决办法。类是找到的,就是加载出问题,出问题的可能很多。
twht 2009-07-14
  • 打赏
  • 举报
回复
D:\JAD\c>java com.apex.util.license.writer.MainFrame
Exception in thread "main" java.lang.NoClassDefFoundError: org/jdesktop/layout/G
roupLayout$Group (wrong name: javax/swing/GroupLayout$Group)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
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)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: com.apex.util.license.writer.MainFrame. Program
will exit.
lxxzhy 2009-07-14
  • 打赏
  • 举报
回复
是不是CLASSPATH忘记加上这个----------->.
tg008007x3 2009-07-14
  • 打赏
  • 举报
回复
没有~-~
紫炎圣骑 2009-07-14
  • 打赏
  • 举报
回复
到D:\c\目录下:执行命令:java com.apex.util.license.writer.MainFrame
临远 2009-07-14
  • 打赏
  • 举报
回复
java com.apex.util.license.writer.MainFrame

MainFrame.class要放在com/apex/util/license/writer/目录下。

62,621

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧