CMD窗口java.lang.NoClassDefFoundError错误

CMD窗口运行程序出现java.lang.NoClassDefFoundError错误


在eclipse上运行没问题,在cmd上运行老是出错

错误: 找不到或无法加载主类 Exam
原因: java.lang.NoClassDefFoundError: CYT/Exam (wrong name: Exam)

在这里插入图片描述
原因:因为这是我在eclipse上的写的程序,属于某一个包

package CYT;

解决方法:先把上面这行代码注释掉就可以了!

猜你喜欢

转载自blog.csdn.net/weixin_44427114/article/details/103654628