How can I get Eclipse 2018.09 to use the JUnit 4 test runner by default?

I also stumbled upon this issue today. It seems that eclipse uses the JUnit 5 runner by default if JUnit 5 dependencies are found on the classpath.

In case of my maven project, investigating the dependency hierarchy showed that actually both JUnit 4 and JUnit 5 dependencies were on the classpath. JUnit 4 as the test dependency I added myself, JUnit 5 as a transitive dependency which I inherited from another library I relied upon. After excluding JUnit 5 from that dependency, eclipse again uses the JUnit 4 runner by default.

Maybe you could check if your project also has an unwanted dependency to JUnit 5 you are not aware of?

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)