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

方法1:我用的这个方法,管用。

首先,查看错误列表windows->Show View->Problems,在有以上问题的同时,还会出现该错误。
The container 'Maven Dependencies' references non existing library 'C:\Documents and Settings\DELL\.m2\repository\com\sun\tools\1.5.0\tools-1.5.0.jar'
大致说:找不到该tools-1.5.0.jar。

所以将C:\Program Files\Java\jdk1.6.0_10\lib\目录下的tools.jar拷贝到C:\Documents and Settings\DELL\.m2\repository\com\sun\tools\1.5.0\目录下,并将tools.jar改名为tools-1.5.0.jar,并在pom.xml中作如下配置:

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

即可!

方法2:我没有用这个方法

手动配置pom.xml,添加一个dependency如下:

<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<scope>system</scope>
<systemPath>${JAVA_HOME}/../lib/tools.jar</systemPath>
</dependency>

3:

< 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 >C:\Program Files\Java\jdk1.6.0_24/lib/tools.jar</ systemPath >
         </ dependency >
     </ dependencies >
</ profile >
4:http://xingda1989.iteye.com/blog/1486966

 

解决方法:修改eclipse.ini 中的配置,加上如下配置:

 

 

-vm

C:\Program Files\Java\jdk1.6.0_30\bin\javaw.exe 

 

重启eclipse,如果还是未解决试着将项目重新导入一遍  :)


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值