maven构建报错:maven-compiler-plugin:3.1:compile (default-compile) on project xxx: Compilatio

梁磊
2023-12-01

具体报错信息:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project xxx: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

原因:
 maven编译需要的是jdk而不是jre. 你的编译器可能配置的是一个jre路径.
解决:
 eclipse→preference→java→Installed JREs中, 把指定的jre路径更改为jdk的路径.

 类似资料: