Repository navigation
Description
If you have a Windows 10 user name that has a space in it, e.g. "Radu Ion", your system TEMP folder will have a space in it and the configured class path, saved in the temp folder, will have a space in it which is not properly escaped. See my launch command configuration:
cd 'd:\RACAI\Workspace\ROBINDialog'; & 'c:\Users\Radu Ion.vscode\extensions\vscjava.vscode-java-debug-0.26.0\scripts\launcher.bat' 'D:\openjdk-14.0.1\bin\java.exe' '-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:55495' '-Dfile.encoding=UTF-8' '@C:\Users\Radu' 'Ion\AppData\Local\Temp\cp_7phc6p6ihdi1ys4lgtonk8k91.argfile' 'ro.racai.robin.dialog.RDManager' 'src\main\resources\precis.mw'
Error: could not open `C:\Users\Radu'
The workaround is to set the TEMP folder to a folder that does not contain spaces, e.g. "C:\Temp".
I did not have this problem say a month ago.
Environment
-
Operating System: Windows 10 Pro, Version 1909
-
JDK version: OpenJDK 14
-
Visual Studio Code version:
Version: 1.45.1 (system setup)
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:27:35.169Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363 -
Java extension version:
Java Extension Pack 0.9.1
Language Support for Java(TM) by Red Hat 0.62.0 -
Java Debugger extension version:
Debugger for Java 0.26.0
Steps To Reproduce
- Make sure you have a user with a name containing a space in it
- Launch any Java debugging process
cd 'd:\RACAI\Workspace\ROBINDialog'; & 'c:\Users\Radu Ion.vscode\extensions\vscjava.vscode-java-debug-0.26.0\scripts\launcher.bat' 'D:\openjdk-14.0.1\bin\java.exe' '-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:55495' '-Dfile.encoding=UTF-8' '@C:\Users\Radu' 'Ion\AppData\Local\Temp\cp_7phc6p6ihdi1ys4lgtonk8k91.argfile' 'ro.racai.robin.dialog.RDManager' 'src\main\resources\precis.mw'
Current Result
Error: could not open `C:\Users\Radu'
Expected Result
Process debugging is started
Activity
dflorey commentedon Sep 15, 2020
Same problem here:
$ "c:\Users\Daniel Florey\.vscode\extensions\vscjava.vscode-java-debug-0.
28.0\scripts\launcher.bat" "C:\Program Files\Java\jdk1.8.0_151\bin\java.
exe" -agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:55
456 -Dfile.encoding=UTF-8 -cp C:\Users\DANIEL~1\AppData\Local\Temp\cp_2gh
bzvwl0y68bjior2opamzgo.jar com.floreysoft.App
'C:\Users\Daniel' is not recognized as an internal or external command,
operable program or batch file.
pavelhoral commentedon Nov 27, 2020
The issue seems to be with automatically inherited (git) bash shell. Can be fixed by changing shell to
cmd.exe.palashencode commentedon Dec 7, 2020
Thanks pavel, it works that way, but its not really a fix though. Gitbash is the standard terminal i use for everything, and this seems to be a simple escaping path name issue.
pavelhoral commentedon Dec 7, 2020
You are right. I did not realize I am changing terminal for the whole platform, which is very very inconvenient. Changing terminal just for the debugger would be more acceptable workaround.
palashencode commentedon Dec 7, 2020
yes I tried that, it seems to work. I added this property in
settings.json, which changes the terminal just for automated tasks, which alleviates the issue to a good degree."terminal.integrated.automationShell.windows": "C:\\Windows\\System32\\cmd.exe"