eclipse创建Junit3的时候正常,创建junit4的时候报错:Access restriction: The type ‘After’ is not API/Access restriction: The type ‘Before’ is not API /Access restriction: The type ‘Test’ is not API
在这里插入图片描述

原因是没有检测到junit4包,于是百度了一下找到了解决方案:
右键项目,选择buildpath-Addlibrary-选择junit,选择你要安装的junit4,系统会自动识别。
成功导入后问题消失。

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐