1 报错信息:

程序包org.junit不存在
在这里插入图片描述

2 问题原因:

junit版本3.x使用的是编程的方式,4.x版本是注解方式

3 解决办法:

将junit版本提高到4.x,配置如下:

<dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <!-- <version>3.8.1</version> -->
            <version>4.12</version>
            <!-- <scope>test</scope> -->
            </dependency>
    </dependencies>

4 成功!

在这里插入图片描述

更多推荐