程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了无法从 Windows IntelliJ 编译 WSL2 中的 Maven 项目大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决无法从 Windows IntelliJ 编译 WSL2 中的 Maven 项目?

开发过程中遇到无法从 Windows IntelliJ 编译 WSL2 中的 Maven 项目的问题如何解决?下面主要结合日常开发的经验,给出你关于无法从 Windows IntelliJ 编译 WSL2 中的 Maven 项目的解决方法建议,希望对你解决无法从 Windows IntelliJ 编译 WSL2 中的 Maven 项目有所启发或帮助;

我正在尝试将 IntelliJ 与 WSL2 结合使用,但我遇到了问题。我创建了一个带有简单主类打印 Hello world 的虚拟项目。我将项目放在我的 WSL 文件系统中。当我尝试使用 IntelliJ 运行/构建时,我收到以下消息:

@H_392_5@maven resources compiler: Maven project configuration required for module 'testproject' isn't available. Compilation of Maven projects is supported only if external build is started from an IDE.

为什么会这样?我可以使用从 WSL2 Ubuntu 终端通过 sudo apt get install maven 下载的 maven 很好地构建项目。

解决方法

可能这是因为您的项目位于 Windows 文件系统中。为了解决这个问题,当你创建或打开一个项目时,请确保它的位置在 wsl 目录中(例如 -> \wsl$\Ubuntu\home\andre\IdeaProjectsInWSL\MyProject)。

无法从 Windows IntelliJ 编译 WSL2 中的 Maven 项目

https://www.jetbrains.com/Help/idea/how-to-use-wsl-development-environment-in-product.html#crete_project_for_wsl

大佬总结

以上是大佬教程为你收集整理的无法从 Windows IntelliJ 编译 WSL2 中的 Maven 项目全部内容,希望文章能够帮你解决无法从 Windows IntelliJ 编译 WSL2 中的 Maven 项目所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。