tfire09
tfire09

Reputation: 39

'C:\Users\[UserName]' is not recognized as an internal or external command, operable program or batch file. Java in VsCode

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:

"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

Answers (1)

Sheng Chen
Sheng Chen

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

enter image description here

Update

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

Related Questions