Skip to content

"Run Test with coverage" doesn't work: "Could not find or load main class" #1714

@LeonardoBevilacqua

Description

@LeonardoBevilacqua

Coverage testing isn't working for me. When I run with coverage, the progress monitor spins indefinitely and no coverage information is provided. The test results are displayed correctly if I run without coverage.

I'm seeing the following error in the extension host logs:

Error: Could not find or load main class \-javaagent:c:\\\\Users\\\\myusername\\\\.vscode\\\\extensions\\\\vscjava.vscode-java-test-0.41.1\\\\server\\\\jacocoagent.jar=destfile=c:\\\\Users\\\\myusername\\\\AppData\\\\Roaming\\\\Code\\\\User\\\\workspaceStorage\\\\df684810f26c0547aff1b945ce0cc0fc\\\\vscjava.vscode-java-test\\\\my-project\\\\coverage\\\\jacoco.exec\\ Caused by: java.lang.ClassNotFoundException: \-javaagent:c:\\\\Users\\\\myusername\\\\.vscode\\\\extensions\\\\vscjava.vscode-java-test-0.41.1\\\\server\\\\jacocoagent.jar=destfile=c:\\\\Users\\\\myusername\\\\AppData\\\\Roaming\\\\Code\\\\User\\\\workspaceStorage\\\\df684810f26c0547aff1b945ce0cc0fc\\\\vscjava.vscode-java-test\\\\my-project\\\\coverage\\\\jacoco.exec\\

vscode-java-test Extension version: 0.41.1
VS Code Version:
Version: 1.91.1
Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.19045

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