此环境中未提供编译器。执行mvn clean包时 [英] No compiler is provided in this environment. When execute mvn clean package
问题描述
当我在我的cmd上运行命令
Hi when I run on my cmd the command
mvn clean package
mvn clean package
我遇到编译错误:此环境中未提供编译器。也许你是在运行JRE而不是运行JDK?
I get a compiler error: No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
但是我检查了我的PATH,JAVA_HOME和HOME_M2
But I checked out my PATH, JAVA_HOME and HOME_M2
我还检查了Eclipse中的已安装JRE:
I also checked the Installed JREs in Eclipse:
显然一切都很好,任何关于我为什么会收到这个错误的想法?谢谢!
Apparently everything is ok, any ideas about why do I'm getting that error? Thanks!
推荐答案
你的问题是你的 PATH
只是一个JRE,而不是JDK。
Your problem is that in your PATH
is only a JRE, not a JDK.
您必须将JDK包含在 PATH
中,然后maven会找到它。
You have to include the JDK into your PATH
, then maven will find it.
这篇关于此环境中未提供编译器。执行mvn clean包时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!