Repository navigation
Cannot run JUnit tests since v1.54.0 #4396
Description
Describe the bug
The JUnit cannot run on v1.54.0
To Reproduce
Steps to reproduce the behavior:
- Unzip the project DemoJava
- In VSCode open the folder DemoJava
- Open sandbox/MinMaxTest.java and try to run JUnit tests
Expected behavior
JUnit tests should be able to run like in v1.53.0
A clear and concise description of what you expected to happen.
Screenshots
Error from the log file:
!ENTRY com.microsoft.java.test.plugin 4 0 2026-04-16 17:04:04.544
!MESSAGE failed to resolve the classpath.
!STACK 0
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.microsoft.java.test.plugin.launchers.JUnitLaunchConfigurationDelegate.getJUnitLaunchArguments(JUnitLaunchConfigurationDelegate.java:78)
at com.microsoft.java.test.plugin.launchers.JUnitLaunchUtils.resolveLaunchArgument(JUnitLaunchUtils.java:103)
at com.microsoft.java.test.plugin.handler.TestDelegateCommandHandler.executeCommand(TestDelegateCommandHandler.java:55)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:230)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:220)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:639)
at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: org.eclipse.core.runtime.CoreException: Cannot find 'org.junit.platform.commons.annotation.Testable' on project build path. JUnit 5 tests can only be run if JUnit 5 is on the build path.
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.abort(JUnitLaunchConfigurationDelegate.java:839)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.preLaunchCheck(JUnitLaunchConfigurationDelegate.java:347)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getVMRunnerConfiguration(JUnitLaunchConfigurationDelegate.java:140)
... 17 more
Root exception:
org.eclipse.core.runtime.CoreException: Cannot find 'org.junit.platform.commons.annotation.Testable' on project build path. JUnit 5 tests can only be run if JUnit 5 is on the build path.
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.abort(JUnitLaunchConfigurationDelegate.java:839)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.preLaunchCheck(JUnitLaunchConfigurationDelegate.java:347)
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getVMRunnerConfiguration(JUnitLaunchConfigurationDelegate.java:140)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at com.microsoft.java.test.plugin.launchers.JUnitLaunchConfigurationDelegate.getJUnitLaunchArguments(JUnitLaunchConfigurationDelegate.java:78)
at com.microsoft.java.test.plugin.launchers.JUnitLaunchUtils.resolveLaunchArgument(JUnitLaunchUtils.java:103)
at com.microsoft.java.test.plugin.handler.TestDelegateCommandHandler.executeCommand(TestDelegateCommandHandler.java:55)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:230)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:220)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:639)
at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
If applicable, add screenshots to help explain your problem.
Environment
- macOS and Linux
- JDK 25
- Version : 1.116.0 (Universal)
Validation : 560a9dba96f961efea7b1612916f89e5d5d4d679
Date : 2026-04-15T00:28:13Z
Electron : 39.8.7
ElectronBuildId : 13797146
Chromium : 142.0.7444.265
Node.js : 22.22.1
V8 : 14.2.231.22-electron.0
Système d’exploitation : Darwin x64 22.6.0 - Java extension version: 1.54.0
Additional Information


Activity
snjeza commentedon Apr 18, 2026
@LeducNic Could you try to replace
junit-platform-console-standalone-1.13.4.jarwith junit-platform-console-standalone-6.0.3.jar?CherryDT commentedon Apr 20, 2026
I have the same problem. Downgrading all Java extensions to versions of ~6 months ago fixes it.
LeducNic commentedon Apr 20, 2026
@snjeza Could you tell me what changed between JUnit 1.13.4 and 6.0.3 that could make it work? It seems to have fixed my JUnit problem.
@CherryDT I only downgraded Language support from 1.54.0 to 1.53.0 to fix the problem. Upgrading JUnit to 6.0.3 also seems to fix the problem.
CherryDT commentedon Apr 20, 2026
Ah, good to know - because of this issue I thought I needed to go back to 1.47.0.
llgcode commentedon Apr 22, 2026
Same issue here, also reproduces with redhat.java 1.54.0 and is fixed by downgrading to 1.53.0. Independent of vscjava.vscode-java-test version (reproduced on 0.44.0 and 0.45.0).
Setup
OS: Windows
JDK: JavaSE-21
Eclipse-style project (.project + .classpath, no Maven/Gradle)
JUnit jar on the classpath: junit-platform-console-standalone-1.13.4.jar (declares Automatic-Module-Name: org.junit.platform.console.standalone and Multi-Release: true)
Sample .classpath
Notes
JUnit 4 tests in the same project run fine on 1.54.0 — only JUnit 5 launches fail.
The editor compiles JUnit 5 imports without errors and the Java Projects view does list org.junit.platform.commons.annotation.Testable under the jar, so JDT's compiler model resolves the type but JUnitLaunchConfigurationDelegate.preLaunchCheck's findType(...) returns null.
java.project.referencedLibraries has no effect (managed project).
Cleaning the JDT workspace and regenerating .classpath does not help.
Like @LeducNic, replacing the jar with junit-platform-console-standalone-6.0.3.jar is not an option in our environment, so for now we're pinning redhat.java to 1.53.0.
Notes
JUnit 4 tests in the same project run fine on 1.54.0 — only JUnit 5 launches fail.
The editor compiles JUnit 5 imports without errors and the Java Projects view does list org.junit.platform.commons.annotation.Testable under the jar, so JDT's compiler model resolves the type but JUnitLaunchConfigurationDelegate.preLaunchCheck's findType(...) returns null.
java.project.referencedLibraries has no effect (managed project).
Cleaning the JDT workspace and regenerating .classpath does not help.
Like @LeducNic, replacing the jar with junit-platform-console-standalone-6.0.3.jar is not an option in our environment, so for now we're pinning redhat.java to 1.53.0.
wenytang-ms commentedon Apr 23, 2026
Root cause analysis:
This is caused by a recent change in Eclipse JDT's
CoreTestSearchEngine.findAnnotations()(0edde57, 203dec3c) which switched fromIJavaProject.findType()(ACCEPT_ALL, no restriction checks) toNameLookup.findType()withACCEPT_ANNOTATIONS+checkRestrictions=true.For standalone/fat Multi-Release JARs like
junit-platform-console-standalone-1.13.4.jar(which declaresAutomatic-Module-NameandMulti-Release: true), this new lookup fails to find@Testableeven though the compiler resolves it fine.Upstream issue filed: eclipse-jdt/eclipse.jdt.ui#2959
Workaround: Override
preLaunchCheck()in vscode-java-test'sJUnitLaunchConfigurationDelegateto catch the false-negativeERR_JUNIT_NOT_ON_PATHerror and fall back to the oldIJavaProject.findType()which works correctly with these JARs.wenytang-ms commentedon May 6, 2026
Hi Team, since the PR is merged, so just wait for the next preview bits to this issue, thanks
eclipse-jdt/eclipse.jdt.ui#2960
datho7561 commentedon May 21, 2026
Seems to be working for me now. @wenytang-ms does anything else need to be done here?
CherryDT commentedon Jun 1, 2026
Unfortunately it still doesn't work on v1.55.2026053008 (pre-release).
The first time I run the tests, I get this output in the debug console:
After that, every time I just get a skipped icon for every test and
The test run did not record any output....CherryDT commentedon Jun 2, 2026
Might be so, but then why does the extension by default install the incompatible 1.13 jar? I never manually installed a JUnit jar.
wenytang-ms commentedon Jun 2, 2026
@datho7561 The original
Cannot find @Testableissue is fixed by eclipse-jdt/eclipse.jdt.ui#2960, so this one can be closed.@CherryDT the
NoClassDefFoundError: CancellationTokenyou are now seeing is a different problem (Platform 1.13 jar vs. JDT's new JUnit 6 runner needing Platform 6.x). I will open a new issue to track it.wenytang-ms commentedon Jun 2, 2026
@CherryDT vscode-java does not install JUnit jars itself. The 1.13.x jar comes from your project setup — either a Maven/Gradle dependency, an Eclipse
.classpathentry, or JDT's JUnit classpath container.Could you open a new issue for the
CancellationTokenproblem and include: project type (Maven / Gradle / Eclipse-style), and where thejunit-platform-*1.13.x jars come from (mvn dependency:tree/gradle dependencies/.classpath)? That will help track it separately from this one.CherryDT commentedon Jun 2, 2026
Wait, what do you mean? I am using the "Enable Java Tests" button, see below. This auto-installs the JUnit 1.13 JAR. I only ever installed the auto-recommended Java extension pack, nothing manually regarding Java or tests.
2026-06-02_08-41-47.mp4
But regardless, I think in VSCode I should be able to run tests even from previous projects that use JUnit 5, not only JUnit 6... it's not reasonable to require updating projects because of updating an extension... not every existing project will be on the latest library versions always! (And even then, the error should be "JUnit 5 is not supported with this extension. Please run tests manually in the terminal or upgrade to JUnit 6", not a cryptic
java.lang.NoClassDefFoundErroror "no output generated".)wenytang-ms commentedon Jun 2, 2026
@CherryDT You are right — sorry for the confusion. The jar does get installed by vscode-java-test's "Enable Java Tests" action (it downloads the latest
junit-platform-console-standalonefrom Maven Central, which is currently Platform 1.13.x). And you are right that existing JUnit 5 projects should keep working.This is actually a regression in vscode-java-test (introduced by JUnit 6 support), not in vscode-java. Could you open an issue at microsoft/vscode-java-test#1866 with your video and details so we can track and fix it there? Thanks!
CherryDT commentedon Jun 2, 2026
But then again why does it work with latest
vscode-java-testwhen I downgradevscode-javato 1.53? So, clearly, this extension has a part in this. I'm confused how this is a purevscode-java-testissue then, am I missing something?Also, your message feels a bit incoherent (what does "open an issue at [link to existing issue about same thing]" even mean), and I notice you like using the em-dash character
—much... are you an AI, if you don't mind me asking? I would like to make sure my messages are read by a human being! (If not, sorry for asking.)wenytang-ms commentedon Jun 3, 2026
@CherryDT You're right that vscode-java is part of the chain, and sorry the earlier comments were confusing on that.
What actually happens: the
JUnit6TestReferenceclass (the one importingCancellationToken) was added on the JDT-LS server bundled with vscode-java 1.54. On 1.53 that class wasn't there yet, so the launcher fell back to the JUnit 5 path and your 1.13.x jar worked. After 1.54 the JUnit 6 runner is present, plus there's an upstream JDT routing bug (eclipse-jdt/eclipse.jdt.ui#2959) that misidentifies anyjunit-platform-console-standalonejar as Platform 6.x.So a 1.13 jar gets handed to the new runner, which can't find
CancellationToken.That's why downgrading to 1.53 hid the symptom.
The fix for your case is the upstream JDT routing fix, not a workaround on the vscode-java-test side. Once that fix is released and the next JDT-LS server is bundled into vscode-java, your existing 1.13 jar will be routed back to the JUnit 5 runner the way it used to be. You do not need to migrate to JUnit 6 or swap any jars. Until then, staying on 1.53 is a reasonable short-term option.
(Separately, microsoft/vscode-java-test#1868 changes "Enable Java Tests" so fresh projects pick the latest stable rather than the 1.13.0-M3 milestone returned by the now-stale Maven search index. That is a quality fix for new setups and unrelated to your existing project.)
Closing this issue since the original
Cannot find @Testablepart is fixed, and the newCancellationTokensymptom is tracked upstream at eclipse-jdt/eclipse.jdt.ui#2959. Sorry again for the earlier misdirection about "open an issue".wenytang-ms commentedon Jun 4, 2026
The remaining
NoClassDefFoundError: CancellationTokenis fixed in Test Runner for Java pre-release0.45.2026060403. Root cause was thatEnable Java Testsdownloadedjunit-platform-console-standalone-1.13.x(Platform 1.x, noCancellationToken) even when JDT routed through the JUnit 6 runner.Fixes:
maven-metadata.xmlper chosen kind (JUnit 5 →1.14.4, JUnit Jupiter 6 →6.1.0).For already-broken projects: delete the old
lib/junit-platform-console-standalone-1.13.*.jar, then re-run "Enable Java Tests" and pick the version matching your code.@datho7561 just close this issue as fixed — please reopen if it reproduces on a clean setup.
kathyrollo commentedon Jun 26, 2026
This issue is not fixed and somehow just randomly started happening to my JUnit 5 tests.
I am uncertain if it has anything to do with updating to
Visual Studio Code 1.126, but rolling back VSC itself did not fix the issue and I have no interest spending any more time on this.The workaround is to downgrade to
redhat.java 1.53.0:All Java extensions remain on the latest version:
Hope this saves someone 2 hours of troubleshooting.
wenytang-ms commentedon Jun 26, 2026
@kathyrollo Thanks for the update.
The compatible fix requires both sides to be updated:
redhat.java1.55.0or newer0.46.0or newerredhat.java1.55.0contains the JDT-LS/JDT fix, and Test Runner for Java0.46.0contains the matching fixes for test discovery and bundled JUnit/ASM dependencies. I verified this combination with a plain Eclipse Java project usingjunit-platform-console-standalone-1.13.4.jar, and the JUnit 5 tests were discovered correctly.Could you please update Test Runner for Java to
0.46.0and try again? If it still reproduces withredhat.java >= 1.55.0and Test Runner for Java>= 0.46.0, please share a small sample project and the Java extension logs so we can investigate the remaining case.kathyrollo commentedon Jun 26, 2026
Hi @wenytang-ms ,
I confirm this combination works:
Test Runner in VSC:
Thanks.
wenytang-ms commentedon Jun 26, 2026
@datho7561 you may close this issue.
llgcode commentedon Jun 29, 2026
Hello,
on my side I still have the problem, and it concerns a lot of users in my company and the only workaround that work is to use 1.53 version of the java extension.
I try to share a reproductible environment.
Also, I've heard some eclipse users have a similar issue updating their eclipse environment
java-test-issue.zip
Detect renamed junit-platform-console-standalone JARs via manifest
llgcode commentedon Jun 29, 2026
It is worth mentioning that our company has renamed this jar to junit4.jar ^^ in the above workspace sample I've renamed the file to org.junit.platform.console.standalone-1.13.4.jar so that you view the right name/version of this jar. Hope it will guide you to the right fix. Thank you for your support
Detect renamed junit-platform-console-standalone JARs via manifest
Detect renamed junit-platform-console-standalone JARs via manifest
Detect renamed junit-platform-console-standalone JARs via manifest
Detect renamed junit-platform-console-standalone JARs via manifest