Problem
A JetBrains IDE on Windows fails to start with an internal error when the most recent project is located on a WSL filesystem (\\wsl$\ or \\wsl.localhost\). The welcome screen does not appear; instead, the IDE shows the following error and exits:
java.lang.RuntimeException: java.util.concurrent.ExecutionException: com.intellij.execution.ExecutionException: Cannot find wsl.exe in %PATH%, please install WSL
at com.intellij.util.ExceptionUtil.rethrow(ExceptionUtil.java:147)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.awaitWithCheckCanceled(...)
...
Caused by: com.intellij.execution.ExecutionException: Cannot find wsl.exe in %PATH%, please install WSL
at com.intellij.execution.wsl.WSLDistribution.doPatchCommandLine(WSLDistribution.java:268)
at com.intellij.platform.ide.impl.wsl.WslIjentDeployingStrategy.createShellProcess(...)
Cause
On startup, the IDE automatically reopens the most recently used project. When that project is located on WSL, the IDE invokes wsl.exe to access the filesystem through the IJent layer. If wsl.exe cannot be resolved via the %PATH% environment variable, the startup sequence fails before the welcome screen can be displayed.
Common reasons wsl.exe is missing from %PATH%:
- WSL was uninstalled.
- An unrelated software uninstaller removed the WSL entry (typically
C:\Windows\System32) from thePathenvironment variable. - WSL was never installed, but a project path under
\\wsl$\or\\wsl.localhost\is recorded in the recent projects list.
Resolution
Option 1: Restore wsl.exe in the PATH
If WSL is installed, ensure that the directory containing wsl.exe (C:\Windows\System32 by default) is present in the Path environment variable:
- Open Settings | System | About | Advanced system settings | Environment Variables.
- Under User variables or System variables, select Path and click Edit.
- Add
C:\Windows\System32if it is missing, then click OK to save. - Open a new terminal and run
wsl.exe --versionto confirm the executable is resolvable. - Start the IDE.
If WSL is not installed, install WSL before launching the IDE.
Option 2: Skip auto-opening the recent project
If restoring the Path variable is not immediately possible, prevent the IDE from auto-opening the WSL project so that the welcome screen can load:
- Close the IDE.
- Open the IDE configuration directory.
- Rename or delete
options/recentProjects.xml. - Start the IDE. The welcome screen opens without attempting to reopen the WSL project.
After the IDE starts, fix the Path variable as described in Option 1, or open the project from a non-WSL location.
Comments
0 comments
Please sign in to leave a comment.