Eclipse Java IDE JUnit5: junit.jupiter.api.Assertions is not accessible

前端 未结 1 1630
渐次进展
渐次进展 2020-12-22 00:39

I\'m new to the whole programming stuff but here\'s my problem:

I used to add my JUnit test cases in Eclipse by right clicking on the project, and just add New >

相关标签:
1条回答
  • 2020-12-22 01:12

    You use the Java Platform Module System (JPMS) by having a module-info.java file in the default package probably without the required requires <module>; statement. JPMS was introduced in Java 9.

    Do one of the following:

    • Delete the module-info.java file (if needed, you can recreate it via right-clicking the project folder and choosing Configure > Create module-info.java)
    • In module-info.java add the corresponding requires statement, e.g. by going to the line with the import statement and using the corresponding Quick Fix (Ctrl+1)
    0 讨论(0)
提交回复
热议问题