Missing artifact com.sun:tools:jar:1.7解决方案

时间:2024-10-09 14:36:57

在配置Java + Robotframework时遇到的问题“Missing artifact com.sun:tools:jar”

1. 先检查一下eclipse或STS中的JDK路径配置是否正确(打开window-->preferences-->java-->installed jres 页面的窗口)

Missing artifact com.sun:tools:jar:1.7解决方案

Missing artifact com.sun:tools:jar:1.7解决方案

2. 在eclipse安装路径下找到eclipse.ini或STS.ini,将其文件打开,在文件中找到“-vmargs”,在“-vmargs”之前添加下面代码。其中 D:\tools\java\jdk1.7 替换成自己的JAVA_HOME路径记录。

-vm
D:\tools\java\jdk1.7\jre\bin\server\jvm.dll

3. 在pom文件中添加下面配置

 <dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.7.8</version> //自己的java版本号
<scope>system</scope>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>

引用: http://blog.****.net/u013281331/article/details/40824707

https://www.cnblogs.com/gaoxu007/p/7204827.html