Maven 无法在 Intellij 中识别

acr*_*ene 5 java intellij-idea maven

我在运行 spring-boot 服务器时确实在 intellij 中收到此错误消息:

'mvn' is not recognized as an internal or external command, operable program or batch file
Run Code Online (Sandbox Code Playgroud)

当我尝试使用以下命令构建项目文件夹中的项目时,它无法识别 Maven:mvn spring-boot:run

我通过下载maven解决了这个问题: https: //maven.apache.org/install.html 并手动将apache-maven-3.5.3文件夹中的bin文件添加到库中

似乎有点落后了。还有其他/更好的方法吗?

小智 2

如果 Maven 是通过以下方式手动安装的:http://maven.apache.org/download.cgi和:'mvn' is not recognized as an internal or external command, operable program or batch file。只需重新启动您的 IntelliJ IDEA并再次运行您的 spring-boot 服务器即可!