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,系统会自动识别。
成功导入后问题消失。