Reputation: 39
I have been trying to work with Java in VsCode but I am consistently met with my C drive being used as an internal or external command. I've seen a lot of different attempts for this, but I've tried as many approaches that I could find.
Such as:
Using JAVA_HOME leading to the path of the jdk and using (C:\Program Files\Java\jdk-15.0.1) and added it to the system variable path to point to the bin folder (%JAVA_HOME%\bin) Although vs code cant detect JAVA_HOME. I've even used the raw path to test, along with trying a semi colon.
I've changed the java runtime configuration and it even detects the path to the JDK.
"java.home": "C:\\Program Files\\Java\\jdk-15.0.1",
"java.help.firstView": "gettingStarted",
"files.exclude": {
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true
},
"java.configuration.runtimes": [
{
"name": "JavaSE-15",
"path": "C:\\Program Files\\Java\\jdk-15.0.1",
"default": true
}
]
Yet when I run it, I get this problem.
".29.0\scripts\launcher.bat" "C:\Program Files\Java\jdk-15.0.1\bin\java.e xe" --enable-preview -XX:+ShowCodeDetailsInExceptionMessages -Dfile.encoding=UT F-8 -cp "C:\Users\Taurian Graham\AppData\Roaming\Code\User\workspaceStor age\51369a30369ac4d6349b938297a92186\redhat.java\jdt_ws\Test_8cb94999\bin"
App 'C:\Users\Taurian' is not recognized as an internal or external command, operable program or batch file."
I've read that the workspace storage can cause problems and that deleting it or removing it can fix it, but that hasn't worked either, it just regenerates. At this point, I am at a loss.
Upvotes: 0
Views: 2011
Reputation: 1275
Seems somethings wrong when executing commands with the whitespace in the terminal.
Maybe you can try to let the debugger executes the program in the internal console.
Just update the setting java.debug.settings.console
to internalConsole
You can also try to change the default terminal to PowerShell or CMD. See: https://github.com/microsoft/vscode-java-debug/issues/678#issuecomment-551032970
Upvotes: 1