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 ...
随机推荐
- 深入理解Java线程池
我们使用线程的时候就去创建一个线程,这样实现起来非常简便,但是就会有一个问题: 如果并发的线程数量很多,并且每个线程都是执行一个时间很短的任务就结束了,这样频繁创建线程就会大大降低系统的效率,因为频繁 ...
- js是函数式的面向对象编程语言
js是函数式的面向对象编程语言,而非类式的面向对象编程语言
- render组件
[render组件] Render继承于Component. It contians general functionality for all renderers. A renderer is wh ...
- rocketmq--消息的产生(普通消息)
与消息发送紧密相关的几行代码: 1. DefaultMQProducer producer = new DefaultMQProducer("ProducerGroupName") ...
- 01 lucene基础 北风网项目培训 Lucene实践课程 Lucene概述
lucene-core-2.4.1.jar是lucene开发的核心jar包,lucene-analyzers-2.4.1.jar也是必不可少的.lucene-highlighter-2.4.1.jar ...
- 【BZOJ3998】弦论 【后缀自动机】
题意 给定一个长度为n的字符串,求他的第k小子串是什么. 分析 T=0的时候,这个题跟SPOJ-SUBLEX的做法一样,当T=1的时候,不同位置的子串算多个,那么初始化的时候d[u]=cnt[u],没 ...
- int类型与char类型的转换
---------siwuxie095 Java对char类型的数据在底层是按int类型来处理的 (只是显示出来仍然是字符型) 1.int类型与char ...
- jquery入门 动态调整div大小,使其宽度始终为浏览器宽度
有时候我们需要设置宽度为整个浏览器宽度的div,当然我们可以使用相对布局的方式做到这一点,不过我们也可以用jquery来实现. <!doctype html> <html> & ...
- 本地yum源构建以及Docker离线安装
Docker离线安装以及本地yum源构建 在docker的使用过程中有时候会遇到一些私有化部署的问题,就是在一些无法上网的机器上面安装使用dokcer,这就引出了docker的离线安装的问题,dock ...
- win10 家庭版使用注册表关闭windows defender
管理员身份运行 reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender" /v " ...