初始java集群操作遇到的bug1——Missing artifact jdk.tools:jdk.tools:jar:1.8

Missing artifact jdk.tools:jdk.tools:jar:1.8


在上一篇中遇到的一个bug!!!记录下,一般这个应该遇不到,所以如果没遇到请跳过。

1.图解错误

1.在pom.xml中
在这里插入图片描述

2.原因

tools.jar包是JDK自带的,pom.xml中以来的包隐式依赖tools.jar包,而tools.jar并未在库中,只需要将tools.jar包添加到jdk库中即可

3.解决方案

在pom.xml 中添加如下内容:

    <dependency>
            <groupId>jdk.tools</groupId>
            <artifactId>jdk.tools</artifactId>
            <version>1.8</version>
            <scope>system</scope>
            <systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
    </dependency>

4.图解真像

在这里插入图片描述

版权声明:本博客为记录本人自学感悟,转载需注明出处!
https://me.csdn.net/qq_39657909

猜你喜欢

转载自blog.csdn.net/qq_39657909/article/details/85010836