You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

IntelliJ IDEA执行Maven构建或Spring Boot启动时自动关闭问题

IntelliJ IDEA执行Spring Boot启动或Maven clean操作时自动关闭解决方案

错误栈信息

java.io.IOException: Failed to run C:\Windows\system32\wsl.exe --list --quiet: {exitCode=1, timeout=false, cancelled=false, stdout=
Copyright (c) Microsoft Corporation. All rights reserved.

Usage: wsl.exe [Argument]

Arguments:

--install <Options>
Install Windows Subsystem for Linux features. If no options are specified,
the recommended features will be installed along with the default distribution.

To view the default distribution as well as a list of other valid distributions,
use 'wsl --list --online'.

Options:
--distribution, -d [Argument]
Specifies the distribution to be downloaded and installed by name.

Arguments:
A valid distribution name (not case sensitive).

Examples:
wsl --install -d Ubuntu
wsl --install --distribution Debian

--list, -l [Options]
Lists distributions.

Options:
--online, -o
Displays a list of available distributions for install with 'wsl --install'.

--help
Display usage information.
, stderr=}
at com.intellij.execution.wsl.WslDistributionManagerImpl.doFetchDistributionsFromWslCli(WslDistributionManagerImpl.java:141)
at com.intellij.execution.wsl.WslDistributionManagerImpl.loadInstalledDistributionMsIds(WslDistributionManagerImpl.java:39)
at com.intellij.execution.wsl.WslDistributionManager.loadInstalledDistributions(WslDistributionManager.java:135)
at com.intellij.execution.wsl.WslDistributionManager.getInstalledDistributions(WslDistributionManager.java:61)
at git4idea.config.GitExecutableDetector.detectAvailableWsl(GitExecutableDetector.java:187)
at git4idea.config.GitExecutableDetector.runDetect(GitExecutableDetector.java:93)
at git4idea.config.GitExecutableDetector.lambda$detect$0(GitExecutableDetector.java:65)
at git4idea.config.GitExecutableManager.runUnderProgressIfNeeded(GitExecutableManager.java:238)
at git4idea.config.GitExecutableDetector.detect(GitExecutableDetector.java:62)
at git4idea.config.GitExecutableManager.getDetectedExecutable(GitExecutableManager.java:149)
at git4idea.config.GitExecutableManager.getPathToGit(GitExecutableManager.java:106)
at git4idea.config.GitExecutableManager.getPathToGit(GitExecutableManager.java:97)
at git4idea.config.GitExecutableManager.getExecutable(GitExecutableManager.java:112)
at git4idea.config.GitExecutableManager.testGitExecutableVersionValid(GitExecutableManager.java:280)
at git4idea.GitVcs.lambda$activate$0(GitVcs.java:209)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:183)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:705)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:647)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:63)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:170)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.lambda$execute$8(BackgroundTaskUtil.java:206)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)

问题原因

从异常栈可定位根源:IDEA内置的Git可执行文件检测模块扫描WSL环境时,调用wsl.exe --list --quiet命令返回退出码1,最终触发进程崩溃。
该问题核心是当前Windows系统安装的WSL版本过旧,旧版WSL不支持--quiet参数,命令执行后返回帮助信息而非预期的WSL发行版列表,IDEA无法处理该返回结果导致闪退。

解决方案

  • 方案1:升级WSL到最新版本
    打开管理员权限的PowerShell或命令提示符,执行wsl --update,等待WSL内核升级完成后重启电脑即可解决兼容性问题。
  • 方案2:关闭IDEA的WSL Git检测功能
    若无需使用WSL环境下的Git可执行文件,直接关闭对应检测逻辑即可:打开IDEA设置页面,依次进入「版本控制」→「Git」,取消勾选「在WSL中检测Git可执行文件」选项,保存设置后重启IDEA。
  • 方案3:调整IDEA版本
    该问题属于部分IDEA版本的已知兼容性缺陷,可将IDEA升级到2022.2及以上正式版,或降级到2021.3之前的稳定版规避该错误。

内容的提问来源于stack exchange,提问作者Sandeep Goud Karrey

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.25 03:06:04