如何让WSL2与IntelliJ IDEA 2021.1一起工作



我不知道如何让IntelliJ idea 2021.1与WSL一起工作。我花了两天时间在网上搜索,但没能让它正常运行。我可以用WSL中的JDK创建新项目,但当我按下";播放按钮";我收到这个:

Executing pre-compile tasks...
Loading Ant configuration...
Running Ant tasks...
Cannot assign requested address: bind
Synchronizing output directories...
4/16/2021 7:57 PM - Build completed with 1 error and 0 warnings in 77 ms

我也尝试使用WSL的maven,但这也没有帮助。有人知道我做错了什么吗?

Jetbrains添加了一个解决该问题的选项(与您的WLS2/etc/resolv.conf因VPN等而被修改有关(:

https://youtrack.jetbrains.com/issue/IDEA-265522#focus=Comments-27-4808360.0-0

来自问题链接:

谢谢,/etc/wsl.conf中generateResourceConf=false的问题已被重现。该修复程序将在2021.1.x版本中提供,稍后将提供确切的修复版本(请参阅"可用"字段(。

更新到具有修复程序的版本后,请执行以下操作以更改Windows主机IP的获取方式:

Open "Help | Find Action...", locate "Registry..." there and open it.
In the opened "Registry" dialog, find wsl.obtain.windows.host.ip.alternatively registry key (disabled by default) and enable it.
Restart IDE to apply the changes.

最新更新