microsoft / microsoft/vscode-java-test

java.lang.IllegalArgumentException: Error: test loader org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader not found

Aperta
#1,816 11 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@wenytang-ms ci sta già lavorando.

Dal 6/3/2026.

ai-triaged bug gradle high-priority junit test-execution
Lingua principale
TypeScript
Stelle
340
Fork
173
Merge medio
1g 19h
PR unite (30g)
18

Descrizione

I get the above exception in the Debug Console when trying to run unit tests. To be honest, I'm lost as to why.

redhat.java: 1.49.0
vscjava.vscode-java-test: 0.43.2
VS Code: 1.106.2

Full Stack:

java.lang.IllegalArgumentException: Error: test loader org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader not found:
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
NativeConstructorAccessorImpl.java:77
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
DelegatingConstructorAccessorImpl.java:45
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
Constructor.java:500
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
Constructor.java:481
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createRawTestLoader(RemoteTestRunner.java:372)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createLoader(RemoteTestRunner.java:367)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.defaultInit(RemoteTestRunner.java:311)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.init(RemoteTestRunner.java:226)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Caused by: java.lang.NoSuchMethodError: 'void org.junit.platform.commons.util.CollectionUtils.forEachInReverseOrder(java.util.List, java.util.function.Consumer)'
	at org.junit.platform.launcher.core.LauncherConfigurationParameters$Builder.build(LauncherConfigurationParameters.java:143)
	at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:129)
	at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:112)
	at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.<init>(JUnit5TestLoader.java:37)
	... 10 more

	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createRawTestLoader(RemoteTestRunner.java:377)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createLoader(RemoteTestRunner.java:367)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.defaultInit(RemoteTestRunner.java:311)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.init(RemoteTestRunner.java:226)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)

Test related configs from build.gradle:

	testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3'
	testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
	testImplementation('org.springframework.boot:spring-boot-starter-test') {
		exclude group: 'junit', module: 'junit'
	}
	testCompile "org.mockito:mockito-core:2.+"
	testCompileOnly 'junit:junit:4.13.2'
	testCompileOnly 'org.projectlombok:lombok'
	testAnnotationProcessor 'org.projectlombok:lombok'

Any idea what could be the culprit? Thx!

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.