转载:https://blog.youkuaiyun.com/qy20115549/article/details/53004779
在eclipse中,遇到了Missing artifact jdk.tools:jdk.tools:jar:1.8。其他也没有报错,感到很奇怪。

原因:tools.jar包是JDK自带的,pom.xml中以来的包隐式依赖tools.jar包,而tools.jar并未在库中,
只需要将tools.jar包添加到jdk库中即可。
解决方案:在pom文件中添加如下代码即可。
<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.8</version>
<scope>system</scope>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
- 如下图,为解决之后的截图:

本文介绍在Eclipse中遇到Missing artifact jdk.tools:jdk.tools:jar:1.8问题的原因及解决方案。原因是项目依赖了tools.jar包,但该包未在库中。解决方法是在pom.xml中添加依赖配置,指定tools.jar的路径。
1623

被折叠的 条评论
为什么被折叠?



