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
{{ message }}
Repository navigation
Error: Could not find or load main class @x.y.z.argfile #769
And I get this error:
Error: Could not find or load main class
@.var.folders.pn.3p41p2fj14d50n707c7x2p4c0000gn.T.cp_90sfb6m3zinsbhwyvyknqb5hv.argfile
I have no idea where the command line came from... as far as I can tell, it's illegal on Mac to use an "at sign" @ in the command line, and java is trying to interpret that as the main class, so something is wrong.
[attach a sample project reproducing the error] attach logs
Create Maven project in VS Code... install all Java extensions.
Work with project for several months, making many changes. Not sure what details are significant.
@argfile is only supported by java 9 and above, this looks like the debugger uses a wrong approach to shorten the command line.
There are two workarounds to unblock you first:
The first one is to add "shortenCommandLine": "jarmanifest" to your launch.json.
The second one is to change your JAVA_HOME environment variable to /Library
/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home, and close vscode and reopen it again.
Thanks, that works. Would updating my project to Java 11 work as well? I just gave it a try and it that also seems to work without needing your other proposals.
Thanks, that works. Would updating my project to Java 11 work as well? I just gave it a try and it that also seems to work without needing your other proposals.
CORRECT! You don't need the additional workaround if you update the project to Java 11.
User's JAVA_HOME points to JDK 11, his project is Java 8. The debugger will use JDK 8 to launch his application. But the debugger uses a wrong approach @argfile to shorten the command line for the JDK 8.
Cause:
Debugger 0.25.0 version adds a fix to choose the project's Java runtime to launch the application instead of the JAVA_HOME. On the other side, when the debugger computes the approach of shortening the command line length, it still uses the JDK from JAVA_HOME to check the compatibility, where it's supposed to use the project's Java runtime as the checker.
changed the title [-]running debugger in Maven project produces command with illegal @ symbol[/-][+]Error: Could not find or load main class @x.y.z.argfile[/+]on Mar 6, 2020
Activity
testforstephen commentedon Mar 2, 2020
@argfile is only supported by java 9 and above, this looks like the debugger uses a wrong approach to shorten the command line.
There are two workarounds to unblock you first:
The first one is to add
"shortenCommandLine": "jarmanifest"to your launch.json.The second one is to change your JAVA_HOME environment variable to /Library
/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home, and close vscode and reopen it again.
dgh1000 commentedon Mar 3, 2020
Thanks, that works. Would updating my project to Java 11 work as well? I just gave it a try and it that also seems to work without needing your other proposals.
testforstephen commentedon Mar 3, 2020
CORRECT! You don't need the additional workaround if you update the project to Java 11.
dgh1000 commentedon Mar 3, 2020
Okay you can close this (or should I? not sure how this works)
testforstephen commentedon Mar 3, 2020
it still has space to improve in the debugger side, let's keep it open first. i'm trying to deliver some enhancement in the debugger.
testforstephen commentedon Mar 4, 2020
User's JAVA_HOME points to JDK 11, his project is Java 8. The debugger will use JDK 8 to launch his application. But the debugger uses a wrong approach @argfile to shorten the command line for the JDK 8.
Cause:
Debugger 0.25.0 version adds a fix to choose the project's Java runtime to launch the application instead of the JAVA_HOME. On the other side, when the debugger computes the approach of shortening the command line length, it still uses the JDK from JAVA_HOME to check the compatibility, where it's supposed to use the project's Java runtime as the checker.
[-]running debugger in Maven project produces command with illegal @ symbol[/-][+]Error: Could not find or load main class @x.y.z.argfile[/+]