You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NoClassDefFoundError when running JUnit5 tests #971
You can choose one of the above three to workaround the issue.
Reacted by Chris, Rubens Gomes, Moritz Reiter, Chunyang Wang, Leon Maia, Vikram Bansal, jinshihui, Zied Guesmi, Pierre-Yves Bigourdan, Maryline Majiade and 3 more
I downgraded java test runner from 0.22.3 to 0.22.2. Still get same problem
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: org/junit/platform/engine/EngineDiscoveryListener
when running test.
Compiles and runs on command line (a test does fail so would like to debug)
Even downgrade the extension or upgrade jupiter version not help, just add [testImplementation 'org.junit.platform:junit-platform-launcher:1.5.2'] and version MUST 1.5.2, 1.7.0 not work too
Upgrade the org.junit.jupiter:junit-jupiter to 5.6.0
Worked for us as well in a Maven project.
Make sure that there aren't any dependencies in your dependency tree that are transitively causing some of the JUnit versions to be lowered. For example, having both spring-boot-starter-test and junit-jupiter can cause situations like the following, where the main JUnit libraries are on 5.6.2, but the JUnit platform engine is on 1.5.2 instead of 1.6.2:
Even downgrade the extension or upgrade jupiter version not help, just add [testImplementation 'org.junit.platform:junit-platform-launcher:1.5.2'] and version MUST 1.5.2, 1.7.0 not work too
Activity
jdneo commentedon Apr 6, 2020
I can also reproduce this bug in Eclipse 2020-03.
I've created a bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=561797Update: It turns out that it's a bug for buildship: eclipse-buildship/buildship#980
[-]Last version 0.22.3 generates an error when running tests[/-][+]NoClassDefFoundError when running JUnit5 tests[/+]jdneo commentedon Apr 16, 2020
Below are several workarounds before the upstream fixed this issue:
org.junit.jupiter:junit-jupiterto5.6.0testImplementation('org.junit.platform:junit-platform-launcher:1.5.2')0.22.2You can choose one of the above three to workaround the issue.
norricorp commentedon Apr 23, 2020
I downgraded java test runner from 0.22.3 to 0.22.2. Still get same problem
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: org/junit/platform/engine/EngineDiscoveryListener
when running test.
Compiles and runs on command line (a test does fail so would like to debug)
csuzdy commentedon May 5, 2020
Downgrading the extension to 0.22.2 didn't help, but adding testImplementation('org.junit.platform:junit-platform-launcher:1.5.2') fixed the issue.
pnhung commentedon May 19, 2020
Even downgrade the extension or upgrade jupiter version not help, just add [testImplementation 'org.junit.platform:junit-platform-launcher:1.5.2'] and version MUST 1.5.2, 1.7.0 not work too
kingthorin commentedon May 24, 2020
Worked for us.
PyvesB commentedon Jul 31, 2020
Worked for us as well in a Maven project.
Make sure that there aren't any dependencies in your dependency tree that are transitively causing some of the JUnit versions to be lowered. For example, having both spring-boot-starter-test and junit-jupiter can cause situations like the following, where the main JUnit libraries are on 5.6.2, but the JUnit platform engine is on 1.5.2 instead of 1.6.2:

kim-daeyong commentedon Oct 29, 2020
it work! thanks
MKruschke commentedon Feb 24, 2021
worked for me 👍🏻
maciej-salamon-ftm commentedon Mar 19, 2021
junit-platform-launcher:1.7.1 seems to work fine now
jdneo commentedon Oct 20, 2021
Close this one since it's out of the extension's scope. Please refer to eclipse-buildship/buildship#980 (comment) for a solution. Thanks!
manojboot commentedon Feb 21, 2023
testImplementation('org.junit.platform:junit-platform-launcher:1.5.2')
adding this worked for me