无法解析JUnit导入

编程入门 行业动态 更新时间:2024-10-28 16:20:19
本文介绍了无法解析JUnit导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我目前正在尝试为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导入

本文发布于:2023-05-29 21:32:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/353291.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:JUnit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!