http://stackoverflow.com/questions/1171264/ant-junit-noclassdeffounderror
0
down vote
In eclipse, this happens when you add the junit jar using the Properties->Libaries->Add External JARs...
Rather than using Properties->Libaries->Add Library... which allows you to select Junit3 or Junit4 and automatically adds the hamcrest library to the path.
0
down vote
In eclipse, this happens when you add the junit jar using the Properties->Libaries->Add External JARs...
Rather than using Properties->Libaries->Add Library... which allows you to select Junit3 or Junit4 and automatically adds the hamcrest library to the path.
本文介绍了在 Eclipse 中使用 JUnit 进行单元测试时遇到的一个常见问题:NoClassDefFoundError 错误。文章解释了错误发生的原因,并提供了两种不同的解决方案:一种是通过外部 JAR 文件添加 JUnit 支持,另一种是通过 Eclipse 的内置功能添加 JUnit 库。
1万+

被折叠的 条评论
为什么被折叠?



