在 eclipse
中运行 junit
测试时,我得到了这个 Exception
:
java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
我已经添加了 junit.jar
库文件。
我尝试过不同版本的junit.jar:4.4
、4.8
等
如何解决这个异常?
最佳答案
将 hamcrest-all-X.X.jar
添加到您的 类路径。
截至 2015 年 2 月的最新版本是 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,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14539072/