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
After the upgrade to 0.43 this morning newly cloned repositories (several repositories from my students) will not run JUnits. The stack trace I get is:
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.(JUnit5TestLoader.java:37)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347)
at java.base/java.lang.Class.newInstance(Class.java:645)
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)
The project is configured to use JUnit 5.9.1.
Downgrading to version 0.42 resolved this error.
Already-cloned repositories continue to work normally on version 0.43, for what it's worth; it seems to be only newly-cloned ones that fail.
The description of Test Runner for Java tells us, that it's fine to use JUnit 5.1.0+. The change log does not tell anything about this.
It's pretty annoying when your tests are suddenly failing with such an error and you have to debug this until finding out that somehow an update of the Test Runner Plugin maybe is the problem. (Keep in mind, that you sometimes upgrade plugins and don't see the problem immediately, but days later...)
But I want to understand the problem:
What is the dependency between the projects JUnit version and Test Runner for Java ? I think there is also a dependency from Test Runner for Java and the Java Language Support Plugin. Is this true?
Or in other words: Is there something we could do to prevent this kind of error in the future? Is it somehow possible to make the JUnit version in the project independent from the plugins version? (My team member also use other IDEs... not sure if we always find "the right JUnit version" for all IDEs)
What is the dependency between the projects JUnit version and Test Runner for Java ? I think there is also a dependency from Test Runner for Java and the Java Language Support Plugin. Is this true?
The problem is that the junit test runner embedded in this extension, which is an upstream dependency changes the requirement.
Is there something we could do to prevent this kind of error in the future?
If it's maven project, maybe we can just update the documents as the approach. If it's gradle, we have feature called 'Delegate test to Gradle', which will directly let gradle to run the tests, just like running thtough gradle command in terminal.
In case anybody else runs into this issue, here’s a fix:
Rather than pinning the JUnit dependency to a different minor version every time this plugin is updated, adding junit-platform-launcher as a project dependency appears to fix the problem.
Here’s what the dependencies section of a build.gradle looks like after applying that fix:
Activity
jdneo commentedon Nov 12, 2024
Hi UTD-MrPeterson Please update the junit version to 5.10+ and try again
nikfalstie commentedon Nov 13, 2024
I had the same issue and resolved it by updating the junit jupiter version. I added the following line to the build.gradle file (its a Spring project)
ext['junit-jupiter.version'] = '5.11.3'PS: The problem did occur for me even though it was not a newly cloned repository.
[-]Version 0.43: JUnits won't run on newly cloned repositories[/-][+]JUnit 5.10+ is required to run tests[/+]jdneo commentedon Nov 13, 2024
Changed title and pin the issue.
circlesmiler commentedon Nov 21, 2024
The description of Test Runner for Java tells us, that it's fine to use JUnit
5.1.0+. The change log does not tell anything about this.It's pretty annoying when your tests are suddenly failing with such an error and you have to debug this until finding out that somehow an update of the Test Runner Plugin maybe is the problem. (Keep in mind, that you sometimes upgrade plugins and don't see the problem immediately, but days later...)
But I want to understand the problem:
What is the dependency between the projects JUnit version and Test Runner for Java ? I think there is also a dependency from Test Runner for Java and the Java Language Support Plugin. Is this true?
Or in other words: Is there something we could do to prevent this kind of error in the future? Is it somehow possible to make the JUnit version in the project independent from the plugins version? (My team member also use other IDEs... not sure if we always find "the right JUnit version" for all IDEs)
jdneo commentedon Nov 22, 2024
The problem is that the junit test runner embedded in this extension, which is an upstream dependency changes the requirement.
If it's maven project, maybe we can just update the documents as the approach. If it's gradle, we have feature called 'Delegate test to Gradle', which will directly let gradle to run the tests, just like running thtough gradle command in terminal.
test: update junit due to microsoft/vscode-java-test#1740
test: update junit due to microsoft/vscode-java-test#1740
Enable debugging of tests in VS Code:
Update user parsing to include custom attributes (#827)
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
27 remaining items
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
Once again bumped JUnit to match VS Code plugin
pcantrell commentedon Aug 28, 2025
In case anybody else runs into this issue, here’s a fix:
Rather than pinning the JUnit dependency to a different minor version every time this plugin is updated, adding
junit-platform-launcheras a project dependency appears to fix the problem.Here’s what the
dependenciessection of abuild.gradlelooks like after applying that fix: