Skip to content

vscjava.vscode-java-test-0.43.1 includes JaCoCo 0.8.12 instead of 0.8.13 #1793

Closed as duplicate

Description

When I run JUnit test with code coverage in VS Code, I get a plenty of

java.lang.instrument.IllegalClassFormatException: Error while instrumenting com/sun/tools/attach/VirtualMachine with JaCoCo 0.8.12.202403310830/dbfb6f2.
	at org.jacoco.agent.rt.internal_aeaf9ab.CoverageTransformer.transform(CoverageTransformer.java:94)
...
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 69
	at org.jacoco.agent.rt.internal_aeaf9ab.asm.ClassReader.<init>(ClassReader.java:200)

The class file major revision is emitted by Java 25.

JaCoCo 0.8.13 can instrument class files with major revision 69.

According to the CHANGELOG, vscode-java-test 0.43.1 has been updated to to Jacoco 0.8.13. However, after installing vscode-java-test-0.43.1, I find .vscode\extensions\vscjava.vscode-java-test-0.43.1\server\jacocoagent.jar still to be version 0.8.12.

I can manually fix the bug, by replacing .vscode\extensions\vscjava.vscode-java-test-0.43.1\server\jacocoagent.jar by https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.agent/0.8.13/org.jacoco.agent-0.8.13.jar

Maybe, the bug is in this line: https://github.com/microsoft/vscode-java-test/blob/0.43.1/scripts/buildJdtlsExt.js#L79

Activity

  1. github-actions commented on Sep 30, 2025

    @github-actions

    Hi René Wörzberger (@woerzberger), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.

    The issue is a known regression in the 0.43.1 updater script: the existing jacocoagent.jar isn’t overwritten when you upgrade, so you still get 0.8.12 instead of 0.8.13.

    • Workaround (from #1780):

    • Uninstall the Java Test extension and then install it anew to force the updated jacocoagent.jar (0.8.13) to be copied.
    • Or manually delete {extension}/server/jacocoagent.jar before upgrading so the new jar is applied.

    • Manual fix: replace {extension}/server/jacocoagent.jar with the 0.8.13 jar from Maven Central:
    https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.agent/0.8.13/org.jacoco.agent-0.8.13.jar

    • Root cause: buildJdtlsExt.js skips copying if the jar already exists (see #1780).

    Other references with low confidence

    Click to expand

    • Coverage is not displayed for tests with @QuarkusTest (#1719): version mismatch between project Jacoco and extension Jacoco
    • Extension not loading – jacoco error (#1759): discusses ASM/Jacoco conflicts in JDT-LS

    The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions