microsoft / microsoft/vscode-java-debug
"Command 'cmd' not found" when running Java code with WSL as the default profile
オープン
まだ誰も着手していません。
ai-triaged
bug
launch
terminal
- 主要言語
- TypeScript
- スター
- 591
- フォーク
- 429
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 19
説明
When running/debugging Java programs using the extension(s), while having WSL as the default terminal profile, the program can't be run and exits with the following error:
Command 'cmd' not found, but there are 17 similar ones.
fish:
cmd /C "c:\Users\<Username>\.vscode\extensions\vscjava.vscode-java-debug-0.32.1\scripts\launcher.bat "C:\Program Files\AdoptOpenJDK\jdk-11.0.10.9-hotspot\bin\java.exe" -Dfile.encoding=UTF-8 -cp C:\Users\<Username>\AppData\Roaming\Code\User\workspaceStorage\f2ff3effae7386c130fa74d8c23d1e02\redhat.java\jdt_ws\Izzivi_163d1b63\bin Izziv5 "
The error occurs on multiple shells (both Bash and Fish tested), so this is not a Fish-specific issue.
Calling cmd.exe instead of cmd might fix the issue, since cmd.exe is available from WSL, while just cmd isn't.
Environment
- Operating System: Windows 10
- JDK version: 11 (AdoptOpenJDK)
- Visual Studio Code version: 1.55.1
- Java extension version: (Java Extension Pack?) v0.13.0
- Java Debugger extension version: v0.32.1
Steps To Reproduce
- Use Ubuntu (WSL) as the default shell
- Try to Run or Debug a Java project
- The runner/debugger fails with the above error
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
この失敗は scripts/launcher.bat で発生し、Ubuntu または WSL をデフォルトのシェルとして Run または Debug を起動したときに起こります。Windows 10 でこれらの手順を再現し、launcher コマンドがどのように形成されるかを調べ、Bash と Fish の両方で結果を確認してください。Java プログラムが “Command 'cmd' not found” エラーなしで実行およびデバッグできれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, typescript, vscode
- 領域
- devtools, operating-systems
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100