操作系統 Windows 10/11 下,IDEA 最新版本。
有時候打開一些 class 文件,會提示 Download Source ,點擊下載時報錯:
Cannot connect to the Maven process. Try again later. If the problem persists, check the Maven Importing JDK settings and restart IntelliJ IDEA
我碰到的問題是無法下載 vert.x 的源碼,其他依賴庫沒問題。
這個問題具體原因請看 https://intellij-support.jetbrains.com/hc/en-us/articles/360014262940
解決辦法:
用管理員賬號編輯 C:\Windows\system32\drivers\etc\hosts 文件,把如下兩行前面的註釋乾點
127.0.0.1 localhost
::1 localhost
保存,重啓 IDEA 後解決。