我目前正在尝试为Java项目(Eclipse)创建JUnit测试.但是,每当我向项目中添加新的JUnit测试用例时,就会不断出现奇怪的错误: ibb.co/ekon9J 当我尝试使用Eclipse的快速修复功能时,尽管它已经存在,但它再次将JUnit 5添加到了构建路径.一切似乎都已正确设置,但仍然无法正常工作.我尝试按照类似线程中的建议清理/关闭项目.不幸的是,没有任何帮助.有人对这里发生的事情有想法吗?
I'm currently trying to create JUnit tests for my Java project (eclipse). However, a weird error keeps showing whenever I add a new JUnit Test Case to my project: ibb.co/ekon9J When I try to use the Quick Fix function of the Eclipse, it adds the JUnit 5 to the build path again, although it's already there. All seems to be set up correctly, but it's still not working. I tried cleaning/closing the project as someone suggested in a similar thread. Unfortunately, nothing helped me. Does anyone have an idea on what's going on here?
:这是Java Build Path库选项卡的打印屏幕: ibb.co/dUgiGy
: Here's the print screen of the Java Build Path libraries tab: ibb.co/dUgiGy
推荐答案最后,得到了答案.就我而言,解决方案是将Build路径中的JRE更改为Java SE 1.8.现在一切正常.
Finally, got an answer. In my case, the solution was to change the JRE in Build path to Java SE 1.8. Now everything works fine.
更多推荐
无法解析JUnit导入
发布评论