Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ecilpse/junit5:Test cannot be resolved to a type

My eclipse seems not to be able to resolve JUnit 5 types when I write a test in a Java 9 module:

enter image description here

"Test cannot be resolved to a type"

I manually have added the JUnit 5 Library to the projects buildpath. Also I did these "clean project" and "update eclipse from pom.xml" kind of things.

When I build this project with the embedded Maven there is no problem, the test is compiled and executed.

Is it an eclipse bug in conjunction with java 9 modules or how do i have to configure eclipse correctly?

Configuration:

  • eclipse Oxygen.2
  • JDK 9.0.1
like image 511
coder Avatar asked Aug 17 '26 09:08

coder


1 Answers

There are some issues related to Java9 and Junit5 here https://github.com/junit-team/junit5/issues/425

A way out of this is using the support for Oxygen:

https://marketplace.eclipse.org/content/junit-5-support-oxygen

like image 178
A Monad is a Monoid Avatar answered Aug 20 '26 00:08

A Monad is a Monoid