Maven项目编译时报错缺少tools.jar
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project ERP: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files\Java\jre7\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[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
解决方案
步骤一:Window -> Preferences -> Java -> installed JREs ->点击"Add"按钮,选择默认的"Standard VM", 点击"Next >", 点击"JRE home"右边的"Directory"选择目录 C:\Program Files\Java\jdk1.7.0_60\jre,“确定”回 到"Installed JREs"界面,勾选刚添加的"jdk1.7.0_60"。
步骤二:Window -> Preferences -> Java -> installed JREs -> 点选界面左侧的"JaveSE-1.7",然后在右侧勾选"jdk1.7.0_60"。
-vm
C:\Program Files\Java\jdk1.7.0_60\jre\bin\javaw.exe
步骤四:重启Eclipse,一切OK了。
问题分析
系统装了两个JRE,应该用JDK中的那个JRE
java
|—jdk1.7.0_60
|—jre
|—jre7
系统默认使用java/jre7,但是该目录下没有tools.jar。所以需要使用java/jdk1.7.0_60/jre,该目录下存在tools.jar包
Maven项目编译时报错缺少tools.jar的更多相关文章
- maven项目编译报错处理
1.问题一: [ERROR] Failed to execute goal on project data-common: Could not resolve dependencies for pro ...
- maven项目编译报错:Type Dynamic Web Module 3.0 requires Java 1.6 or newer.
在maven的pom.xml文件中增加: <build> <plugins> <plugin> <groupId>org.a ...
- tomcat启动窗口报错&&eclipse使用maven编译时报错
tomcat启动窗口报错log4j:ERROR Could not find value for key log4j.appender.stdoutlog4j:ERROR Could not inst ...
- 在Myeclipse buildpath 加server lib (server runtime)/项目导入时报错:The import javax.servlet.http.HttpServletRequest cannot be resolved
来源于:http://blog.csdn.net/dingqinghu/article/details/8805922 http://yl-fighting.iteye.com/blog/140946 ...
- eclipse 中导入 maven项目 启动报错
导入Maven项目到Eclipse中时,出现问题如下: java.lang.ClassNotFoundException: org.springframework.web.context.Contex ...
- idea中 maven打包时时报错User setting file does not exist C:\Users\lenevo\.m2\setting.xml,
第一种错误 :idea中 maven打包时时报错User setting file does not exist C:\Users\lenevo\.m2\setting.xml, 解决方案如下:将ma ...
- 安装asp.net mvc4后mvc3项目编译报错
安装asp.net mvc4之后,之前的mvc3项目编译时报这个错“The type System.Web.Mvc.ModelClientValidationRule exists in both c ...
- maven项目编译通过,测试用例卡住,断点也用不了
maven项目编译通过,测试用例卡住,断点也用不了.如下图 maven的tomcat插件可以运行没报错,但是网页访问一直转圈 原因: 最后发现是typeAliasesPackage这里设置了别名,所以 ...
- 使用Notepad++编码编译时报错(已解决?)
使用Notepad++编码编译时报错(已解决?) 使用Notepad++编码,编译的时候经常会报错,说什么GBK编码啥啥啥~~~但同样的编码用ECLIPSE就没有问题.再有,用记事本把他保存成ANSI ...
随机推荐
- Django 获取时间 和Linux 本地 系统时间 不一致
问题描述 Django 中获取的本地时间 ,和系统时间不一致 错误原因 Django在配置文件settings.py 中 默认配置 UTC世界标准时间,而北京时间是东八区,比UTC时间早8个小时. T ...
- Unity 单例
1. 继承于MonoBehaviour(不随着场景切换而销毁) 基类代码: using System.Collections; using System.Collections.Generic; us ...
- 【原】Coursera—Andrew Ng机器学习—课程笔记 Lecture 14—Dimensionality Reduction 降维
Lecture 14 Dimensionality Reduction 降维 14.1 降维的动机一:数据压缩 Data Compression 现在讨论第二种无监督学习问题:降维. 降维的一个作用是 ...
- NPM设置代理
npm获取配置有6种方式,优先级由高到底. 命令行参数. --proxy http://server:port即将proxy的值设为http://server:port. 环境变量. 以npm_con ...
- JAVA中List的三个子类。
JAVA中List的三个子类分别是:ArrayList,Vector,LinkList.下面就来比较一下他们的不同. ArrayList:底层数据结构是数组,查询快,增删慢,线程不安全,效率高. Ve ...
- 10 华电内部文档搜索系统 search02
搜索项目并不是一个很大的项目,在实际项目中往往是作为子项目和别的项目集成在一起的.比如说和OA项目集成在一起,作为另外一个项目的子系统来使用.搜索项目的功能并不复杂. 整个项目是文档搜索项目,如题:企 ...
- HTML5框架、背景和实体
-----------------siwuxie095 HTML5 框架 1.框架标签 <frame> ...
- 一款比较好用的JS时间控件-laydate
官方讲解:http://laydate.layui.com/ 具体的内容请看官方讲解,此处仅说名应用: 1.在jsp或html或其他中引入laydate.js <script src=&qu ...
- 341. Flatten Nested List Iterator展开多层数组
[抄题]: Given a nested list of integers, implement an iterator to flatten it. Each element is either a ...
- zabbix自动发现监控mysql
一. 数据库给只读权限 1.1 grant usage on *.* to 'zabbix'@'127.0.0.1' identified by 'zabbix'; flush privileges; ...