maven报错Missing artifact jdk.tools:jdk.tools:jar:1.8解决方案

转自:https://blog.csdn.net/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>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

如下图,为解决之后的截图: 
这里写图片描述

猜你喜欢

转载自blog.csdn.net/intelligebce/article/details/80774204
今日推荐