-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Run Test with coverage" doesn't work: "Could not find or load main class" #1714
Comments
Is there any error log in the server log? (Trigger Is it possible to share a sample project to us? |
Here is the log
unfortunately, I cannot share a sample of the project. Additional notes: I used to run the code in another IDE without any problem, recently tried in VSCode with the JAVA Pack extension. Everything worked fine out of the box, running, debugging and testing without issues, only the coverage action doesn't work, but I can run the mvn command to generate the report. |
@LeonardoBevilacqua Is this still a problem in 0.42.0? |
Yes, the still a problem |
What's the jacoco version used in your project? |
I'm guessing that this might be caused by the version of jacoco agent of the project is different from the embedded one in extension. In #1723, I changed to implementation that using the one from project if it's available. Would you mind trying the pre-release |
I've tried the pre-release version, still does not work. I believe the jacoco version is 0.8.10, (not managed by my current project) Edit: I tried with 2 projects, both with the same issue |
Hello. Here we use an internal and "non-sense" framework wich brings jacoco 0.8.8 . I could find a workaround copying the jacoco.exec of the current project found it in your-current-application>target>jacoco.exec to the folder where vscode complains about ClassNotFoundException on your case "-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\" As @jdneo points out. Its something with conflict version. Anyway thanks. I love to work with the vscode. |
@LoveraSantiago Would you mind sharing the project that having this issue? |
Same here, just I cannot share so much of this project :S When I run a test with coverage I receive this error:
|
Same issue here with version 0.43.0. This is on a freshly installed Windows 11 Pro machine. I have the same issue on a different Windows 11 Pro laptop but not on a MacBook Air, always on the exact same project. The issue on Windows affects all the projects I tried. I cannot share files but I can run tests if it helps. |
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
The text was updated successfully, but these errors were encountered: