在Eclipse上执行tomcat7:run错误解决方法

如果在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就解决了。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容