本文介绍了java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 eclipse
中运行 junit
测试时,我收到此 Exception
:
While running junit
test in eclipse
I am getting this Exception
:
java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
我添加了 junit.jar
库文件.
我尝试了不同版本的 junit.jar:4.4
、4.8
等
I've tried different versions of junit.jar: 4.4
, 4.8
, etc.
如何解决此异常?
推荐答案
将 hamcrest-all-X.X.jar
添加到您的 classpath.
截至 2015 年 2 月的最新版本是 1.3:http://code.google.com/p/hamcrest/downloads/detail?name=hamcrest-all-1.3.jar&can=2&q=
Latest version as of Feb 2015 is 1.3:http://code.google.com/p/hamcrest/downloads/detail?name=hamcrest-all-1.3.jar&can=2&q=
这篇关于java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!