缺少工件sun.jdk:tools:jar:1.6.0:system [英] missing artifact sun.jdk:tools:jar:1.6.0:system
本文介绍了缺少工件sun.jdk:tools:jar:1.6.0:system的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Mac,并且在我的pom文件之一中看到了此错误.我在Google周围搜索,并将以下部分添加到pom.xml:
i m using a mac and saw this error in one of my pom file. i googled around and added the following section to the pom.xml:
<profiles>
<profile>
<id>osx</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<properties>
<toolsjar>${java.home}/../Classes/classes.jar</toolsjar>
</properties>
</profile>
</profiles>
...
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.6.0</version>
<scope>system</scope>
<systemPath>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar</systemPath>
</dependency>
...
然后我跑步
mvn clean install -Posx
我仍然遇到相同的错误.请帮忙!
i still got the same error. please help!
推荐答案
使用以下命令将tools.jar从已安装的JDK位置安装到maven存储库.
Use the below command to install tools.jar from your installed JDK location to maven repository.
$mvn install:install-file -DgroupId=sun.jdk -DartifactId=tools -Dpackaging=jar -Dversion=1.6 -Dfile="C:\Program Files\Java\jdk1.6.0_27\lib\tools.jar"
注意:确保上述命令中的JDK安装路径正确.
Note: Make sure that JDK installed path correct in the above command.
这篇关于缺少工件sun.jdk:tools:jar:1.6.0:system的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文