maven Missing artifact com.sun:tools:jar:1.5.0
转自:http://blog.csdn.net/caolaosanahnu/article/details/7918929
http://zuoshahao.com/work/others/missing-artifact-com-suntoolsjar1-5-0/
刚才把之前的一个maven工程导入eclipse后,发现pom.xml打红叉,其问题如下所示:
问题似曾相识,没错,这个在《Could not find artifact com.sun:tools:jar:1.5.0》中曾说过。当时的解决方法是把【Windows】-【Preferences】-【Java】-【Install JREs】中的JRE给remove掉即可,刚才试着remove掉JRE,问题依然存在,如今为何又不行了,这得回公司才知晓。
在pom.xml中添加对tools.jar的依赖,问题解决:
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.6.0</version>
<scope>system</scope>
<systemPath>D:/Java/jdk1.6.0_27/lib/tools.jar</systemPath>
</dependency>
http://blog.csdn.net/sweblish/article/details/6662586
记得以前写过这个错误的解决方案,找了很长时间,自己都没找到,那就只能自己再写一遍了。 解决方案一:
原来,是${java.home}在作怪,eclipse 没有使用 JAVA_HOME 默认,eclipse 使用 C:"windows"system32"javaw.exe 作为 JVM,当然找不到tools.jar 解决方法如下: 修改 eclipse.exe 目录下的 eclipse.ini 指定vm,,注意 -vm后面不能有空格。
-vm
C:\Java\jdk1.6.0_02\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
解决方案二:
配置pom.xml文件
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <spring.version>3.0.5.RELEASE</spring.version>
- <java.home>jdk路径</java.home>
- </properties>
- <profiles>
- <profile>
- <id>default-tools.jar</id>
- <activation>
- <property>
- <name>java.vendor</name>
- <value>Sun Microsystems Inc.</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>com.sun</groupId>
- <artifactId>tools</artifactId>
- <version>1.5.0</version>
- <scope>system</scope>
- <systemPath>${java.home}/lib/tools.jar</systemPath>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
在pom.xml文件中将这段配置写上,试一下。注意几个位置的内容编写。
解决方案三:2014/01/02
如果还不行就到.m2目录下新建文件夹然后把java/bin/tools.jar 拷进去。如下图所示:

maven Missing artifact com.sun:tools:jar:1.5.0的更多相关文章
- Eclipse maven工程 Missing artifact com.sun:tools:jar:1.5.0:system 解决方法
今天同事在使用eclipse,引入一个新的maven工程时报错: Missing artifact com.sun:tools:jar:1.6.0:system 这个问题很奇怪,相同的代 ...
- Maven错误-Missing artifact com.sun:tools:jar:1.5.0:system 解决方式
1.Missing artifact com.sun:tools:jar:1.5.0:system Could not resolve dependencies for project com.ifl ...
- Missing artifact com.sun:tools:jar 1.5.0 终极解决方法
在使用m2eclipse插件时,在pom.xml中添加struts2-core.jar包后,需要依赖java运行时的tools.jar进行依赖.但是,此时eclipse无法读取tools包,出现如下错 ...
- Missing artifact com.sun:tools:jar:1.5.0的解决方案
今天在用maven的时候遇到一个问题pom.xml提示Missing artifact com.sun:tools:jar:1.5.0 试过改eclipse的eclipse.ini文件,也试过在ecl ...
- 开发常见错误之 :Missing artifact com.sun:tools:jar 1.7.0
Missing artifact com.sun:tools:jar 1.7.0 解决办法一: 手动配置pom.xml,添加一个dependency如下: <dependency> < ...
- Missing artifact com.sun:tools:jar:1.5.0解决的方法
前一阵子下了最新的JavaEE版本号的eclipse,导入mavenproject之后,pom文件一直报Missing artifact com.sun:tools:jar:1.5.0.非常纳闷,to ...
- Eclipse maven工程 Missing artifact com.sun:tools:jar:1.7.0:system 解决方法
解决方案一:通过maven取运行时参数,eclipse提供的环境变量,基本类似System.getProperty("java.home") <dependency> ...
- Maven解决Missing artifact com.sun:tools:jar:1.5.0错误
<dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> ...
- Missing artifact com.sun:tools:jar:1.5.0:system 补充
转自:http://blog.csdn.net/sweblish/article/details/6662586 解决方案一: 原来,是${java.home}在作怪,eclipse 没有使用 JAV ...
随机推荐
- MFC中卡拉OK字体的定时器实现,使用DC的DrawText函数实现
void CTextView::OnTimer(UINT_PTR nIDEvent) { m_nWidth += ; // 在构造函数中初始化为 0: CClientDC dc( this ); TE ...
- [Algorithm] Circular buffer
You run an e-commerce website and want to record the last N order ids in a log. Implement a data str ...
- Android 模仿QQ空间风格的 UI
本文内容 环境 演示模仿QQ空间风格的UI 虽然这个 UI 跟现在的QQ空间有点差别,但是也能学到很多东西. 下载 Demo 环境 Windows 7 64 位 Eclipse ADT V22.6.2 ...
- C++中public、protected、private的差别
第一: private,public,protected的訪问范围: private: 仅仅能由该类中的函数.其友元函数訪问,不能被不论什么其它訪问.该类的对象也不能訪问. protected: ...
- ArcGIS 10.4的0x80040228许可错误
今天,再次遇到这个问题,再忙得把它记录下来! AO/AE程序的许可方式 不管是开发环境是基于ArcObject还是基于ArcEngine,不管运行环境是Desktop还是Runtime(早已改名了为A ...
- OS 获取用户相册。保存图片。编辑图片为圆形
// // ViewController.m // YunPhoto // // Created by qingyun on 3/4/14. // Copyright (c) 2014 qingyun ...
- Spring开发 - 通过实现ApplicationContextAware在Servlet中调用注解的Service
用过Spring MVC的人都知道,我们如何在Controller中注入Service,可以使用@Resource注解的方法. 有时候,实际在项目的过程中,我们需要在某个Servlet中使用Servi ...
- maven安装配置部署建项运行
http://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-websocket/1.4.1.RELEA ...
- REP report开发技巧
其他文章 报表开发介绍 posted @ 2017-02-23 18:525 by Mark
- Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'系列二:reset slave
reset slave会清除从库的所有复制信息.一般应用场景:如切换为不同的Master, 主从重做等: 1. 命令在slave上执行,执行前一定要stop slave. 2. 执行reset sla ...