maven项目报错:找不到编译器
2016-04-05 19:42
274 查看
在运行maven项目时,报错
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project taotao-manager-pojo: 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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
大概的意思是说,在当前环境没提供编译器。于是打开 window->preferences->java->install JREs,发现jre是正常配置的。
但是错误报的是找不到编译器,也就是JDK,后面还提醒了一句,也许你是在jre里面运行,而不是jdk。对照上图可以看到,确实是选择的只是jre。我们在安装java的时候,会在java目录下生成jre文件夹,同时在jdk文件夹下也生产jre文件夹。
所以,解决办法就是选择jdk目录下的jre,而不是java目录下的jre。点击edit->directory->选择jdk目录下的jre,就像这样
点击finish,然后在项目上右键->maven->update project,再运行,成功。问题解决
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project taotao-manager-pojo: 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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
大概的意思是说,在当前环境没提供编译器。于是打开 window->preferences->java->install JREs,发现jre是正常配置的。
但是错误报的是找不到编译器,也就是JDK,后面还提醒了一句,也许你是在jre里面运行,而不是jdk。对照上图可以看到,确实是选择的只是jre。我们在安装java的时候,会在java目录下生成jre文件夹,同时在jdk文件夹下也生产jre文件夹。
所以,解决办法就是选择jdk目录下的jre,而不是java目录下的jre。点击edit->directory->选择jdk目录下的jre,就像这样
点击finish,然后在项目上右键->maven->update project,再运行,成功。问题解决
相关文章推荐
- maven学习
- maven插件maven-war-plugin的使用
- jenkins------部署项目到jboss eap下
- maven使用经验集
- window下安装和配置maven环境
- 使用maven+eclipse搭建struts2开发环境
- 使用Eclipse开发工具如何解决Java Compiler中Annotation Processin不出现的问题
- Java随手笔记8之包、环境变量和访问控制及maven profile实现多环境打包
- maven中下载jar包源码和javadoc的命令介绍
- 表单重复提交处理总结
- Maven私服配置记录 Nexus
- maven-war-plugin参数说明
- Maven学习笔记
- 项目构建工具学习与实践总结
- Maven实战(三)Eclipse构建Maven项目
- maven基本要点
- Maven for Eclipse
- maven 使用 问题记录
- 《Maven权威指南》学习笔记四_创建一个简单的Maven项目
- 《Maven权威指南》学习笔记十七_一个多模块项目 3ff0