具体错误
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project CRMProject: 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
问题发生原因
我是把一个在eclipse中写了一个maven项目,然后想导成一个war文件,
也就是在执行 maven install
的时候报错。
问题解析
查看了一下报错原因,它说在这个运行环境没有提供编译器,也就是jdk不存在。
或者说jdk不匹配,
可是项目启动运行环境是完全没问题的。
问题解决
看了网上的解决方案,
1.选择Properties
2.找到 Project Facets 选择把右边Runtimes的tomcat选上就行,
没有tomcat的话就new一个,配置方法跟配置tomcat一样
3.然后点击应用就行了