如果在JAVA EE IDE上运行tomcat7:run的时候出现以下错误。可以参照下方的解决方案
[ERROR]Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Resrauran
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :xinghe-interaction
解决方法:
右键点击项目,在弹出的菜单中选择properties:
点开后,选择Maven项目中的Project Facets,有可能不会显示以下内容,应该会出现一行蓝字(已经点过了,所以就没办法截屏了),点击一下就会出现如下内容,再点击Runtimes,勾选Apache Tomcat v7.0(或其他版本),然后点击ok就解决了:
如果没有Apache Tomcat v7.0,就点击“new",并选择下载在本地的Tomcat版本相对应的版本号。并且点击"Next”:
最后选择路径和JRE就解决了。
网友评论