转自: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文件

  1. <properties>
  2. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  3. <spring.version>3.0.5.RELEASE</spring.version>
  4. <java.home>jdk路径</java.home>
  5. </properties>
  6. <profiles>
  7. <profile>
  8. <id>default-tools.jar</id>
  9. <activation>
  10. <property>
  11. <name>java.vendor</name>
  12. <value>Sun Microsystems Inc.</value>
  13. </property>
  14. </activation>
  15. <dependencies>
  16. <dependency>
  17. <groupId>com.sun</groupId>
  18. <artifactId>tools</artifactId>
  19. <version>1.5.0</version>
  20. <scope>system</scope>
  21. <systemPath>${java.home}/lib/tools.jar</systemPath>
  22. </dependency>
  23. </dependencies>
  24. </profile>
  25. </profiles>

在pom.xml文件中将这段配置写上,试一下。注意几个位置的内容编写。

解决方案三:2014/01/02

如果还不行就到.m2目录下新建文件夹然后把java/bin/tools.jar 拷进去。如下图所示:

maven Missing artifact com.sun:tools:jar:1.5.0的更多相关文章

  1. Eclipse maven工程 Missing artifact com.sun:tools:jar:1.5.0:system 解决方法

    今天同事在使用eclipse,引入一个新的maven工程时报错:      Missing artifact com.sun:tools:jar:1.6.0:system   这个问题很奇怪,相同的代 ...

  2. 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 ...

  3. Missing artifact com.sun:tools:jar 1.5.0 终极解决方法

    在使用m2eclipse插件时,在pom.xml中添加struts2-core.jar包后,需要依赖java运行时的tools.jar进行依赖.但是,此时eclipse无法读取tools包,出现如下错 ...

  4. 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 ...

  5. 开发常见错误之 :Missing artifact com.sun:tools:jar 1.7.0

    Missing artifact com.sun:tools:jar 1.7.0 解决办法一: 手动配置pom.xml,添加一个dependency如下: <dependency> < ...

  6. Missing artifact com.sun:tools:jar:1.5.0解决的方法

    前一阵子下了最新的JavaEE版本号的eclipse,导入mavenproject之后,pom文件一直报Missing artifact com.sun:tools:jar:1.5.0.非常纳闷,to ...

  7. Eclipse maven工程 Missing artifact com.sun:tools:jar:1.7.0:system 解决方法

    解决方案一:通过maven取运行时参数,eclipse提供的环境变量,基本类似System.getProperty("java.home") <dependency> ...

  8. Maven解决Missing artifact com.sun:tools:jar:1.5.0错误

    <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> ...

  9. Missing artifact com.sun:tools:jar:1.5.0:system 补充

    转自:http://blog.csdn.net/sweblish/article/details/6662586 解决方案一: 原来,是${java.home}在作怪,eclipse 没有使用 JAV ...

随机推荐

  1. javascript this详解 面向对象

    在面向对象编程语言中,对于this关键字我们是非常熟悉的.比如C++.C#和Java等都提供了这个关键字     虽然在开始学习的时候觉得比较难,但只要理解了,用起来是非常方便和意义确定的.JavaS ...

  2. Python科学计算技巧积累四——双y轴图像绘制

    双y轴图像具有单y轴图像没有的对比效果,在MATLAB中有plotyy函数可以实现,Python的实现方式没有MATLAB那样方便,不过实现效果却也不见得差. 以往我常用的绘图命令是import ma ...

  3. 我对android 软件栈了解

    android 软件栈如图所示: Android平台的核心是Linux内核,它负责设备驱动程序.资源访问.电源管理和完成其他操作系统的职责.提供的设备驱动程序包括显示器.照相机,键盘.WiFi.闪存. ...

  4. Android -- getWidth()与getMeasuredWidth()

    getWidth() Return the width of the your view. Returns The width of your view, in pixels. 源代码: public ...

  5. (转)溶解shader

    游戏中物体腐化消失,燃烧消失时,会有从局部慢慢消失的效果,然后配合一些粒子特效,就能达到非常好的美术效果.类似效果如下: 注:_DissColor为溶解主色,_AddColor为叠加色,按照溶解的移动 ...

  6. [Docker] Converting from Docker Compose to Kubernetes

    kompose is a tool to help users who are familiar with docker-compose move to Kubernetes. kompose tak ...

  7. iOS 8 swift 键盘不出来 ios 8 uitextfield keyboard not appearing

    ios 8 uitextfield keyboard not appearing //发现在iphone 6 and iPhone plus 上面键盘不出来.后来查了下原来要在模拟器里设置下 var ...

  8. Apache Kafka学习 (一)

    前言:最近公司开始要研究大数据的消息记录,于是开始研究kafka. 市面上kafka的书很少,有的也版本比较落后,于是仗着自己英文还不错,上官网直接学习. ^_^ 1. 开始 - 基本概念 学习一样东 ...

  9. SRA秘钥生成与解密

    import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java ...

  10. javascript将算法复杂度从O(n^2)做到O(n)

    compare the difference of two giving array, return results: 1. elements in both array, 2. elements o ...