今天重新复习spring的时候,调用Junit架包来进行测试,进入其官网  https://junit.org/junit5/,点击右上角的Junit4进行查看

2.出现了的页面是这个样子

我把这个页面上的二个jar的下载下来了,并且还加载到了IDEA里面,没想到还是报错误,

java.lang.NoClassDefFoundError

当时笔者也是相当的犯难,毕竟很久没接触java的里面的一些东西,不是很有印象了,而且还是在一个新的编译器上面编译很多的操作都是是懂非懂。后来在看文档中终于找到了解决的方法。

去官网又看了一下,结果发现这样一段话:

  • junit.jar: Includes the Hamcrest classes. The simple all-in-one solution to get started quickly.Starting with version 4.11, Hamcrest is no longer included in this jar.
  • junit-dep.jar: Only includes the JUnit classes but not Hamcrest. Lets you use a different Hamcrest version.

解决的方案如下:

(1) 换用更小版本的jar包,如4.8.jar

(2 )  junit-4.12.jar + hamcrest-core-1.3.jar

笔者用的第二种方案

JUnit-4.13使用报java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing错误的更多相关文章

  1. 【Junit】JUnit-4.12使用报java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing错误

    下载了最新的JUnit版本,是4.12,结果尝试使用发现总是报java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing这样的错误, 上网查 ...

  2. [转]JUnit-4.11使用报java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing错误

    原文引自: http://blog.csdn.net/castle07/article/details/8553704 今天尝试使用JUnit,下载了最新的JUnit版本,是4.11,结果尝试使用发现 ...

  3. JUnit-4.11使用报java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing错误

    今天尝试使用JUnit,下载了最新的JUnit版本,是4.11,结果尝试使用发现总是报java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribi ...

  4. IntelliJ IDEA工具增加test测试方法,报java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing错误

    是因为我在IntelliJ IDEA中,通过plugins增加 插件的时候,在 增加的测试类是junit4.12,改版本的jar包不再包含hamcrest-library.jar .我是通过将自己的项 ...

  5. java.lang.NoClassDefFoundError:org/hamcrest/SelfDescribing

    1.错误描述 java.lang.NoClassDefFoundError:org/hamcrest/SelfDescribing 2.错误原因 将junit-4.11.jar导入到lib目录中,出现 ...

  6. java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing,

    缺少一个java包,然后我在这个网址找到了http://central.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1. ...

  7. 关于jsp web项目中的javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/el/ELResolver错误

    错误: javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/el/ELResolver org.apache.j ...

  8. javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/el/ELResolver错误解决办法

    今天不用eclipse.myeclipse等开发工具,纯手写JSP页面(有点作死)时突然出现以前从来没遇到过的问题,报错如下: HTTP Status 500 - java.lang.NoClassD ...

  9. IDEAL启动项目的时候报java.lang.NoClassDefFoundError: javax/servlet/Filter错误

    <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring- ...

随机推荐

  1. python 教程 第十九章、 图形界面编程

    第十九章. 图形界面编程 import Tkinter top = Tkinter.Tk() hello = Tkinter.Label(top, text='Hello World!') hello ...

  2. 介绍MFC参与设计模式框架(一个)

    最近我读了一些相关MFC参与设计的花纹纸架,为了帮助您了解MFC在此框架总结,我们希望对大家有帮助. 简介设计模式 设计模式是一套被重复使用.多数人知晓的.经过分类编目的.代码设计经验的总结.使用设计 ...

  3. Qt Installer Framework 3.0.1 Released(功能比较强)

    We are happy to announce the release of Qt IFW 3.0.1. 3.0.1 is fully compatible with 2.0.5, which me ...

  4. Entity framework 更改模型,新增表

    在Package Manager Console 中运行命令Enable-Migrations 再次运行可以更新 抄袭 在实体类中增加一个属性以后,执行 Update-Database 命令 ,可以更 ...

  5. WPF 获得DataGridRow和 DataGridCell的方法

    原文:WPF 获得DataGridRow和 DataGridCell的方法 原文地址 简介 在WPF中,DataGrid控件并没有提供访问其DataGridRow或者DataGridCell的方法. ...

  6. fail2ban防止暴力破解

    安装fail2ban: 将fail2ban 上传到服务器,解压: [root@xuegod1 tmp]# tar -zxvf fail2ban-0.8.14.tar.gz [root@xuegod1 ...

  7. XF 滑块和步进控件

    <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http:/ ...

  8. python 安装 win 下的exe结尾的文件操作

    1.首先下载相关的模块 2.把下载的相关模块放到python 安装目录下 3.cmd 切换到python的安装目录下 例如:{PIL-1.1.7.win32-py2.7.exe} 4.执行 pip i ...

  9. UWP ListView

    ListViewItem项填充整个宽度最大化<ListView.ItemContainerStyle> <Style TargetType="ListViewItem&qu ...

  10. Oracle报错:不是单组分组函数

    报错:不是单组分组函数 实例:select sum(HWJZ) ,rq from  JcChargeInfo 原因: 1.如果程序中使用了分组函数,则有两种情况可以使用: 程序中存在group by, ...