SOLVED: Failed to resolve jdk.tools:jdk.tools:1.6

Article directory

Problem Description

  1. When operating the HBase API client, an error is reported: Unable to resolve jdk.tools:jdk.tools:1.6
    insert image description here
  2. This kind of problem is commonplace. It is nothing more than the dependency is not downloaded, the version problem, the dependency is not loaded successfully, the file index is not updated successfully, and the IDEA file cache is not updated. When I tried all the above, I found that it still didn’t work. By the way, Maven's prompt is as follows:
    insert image description here

solution

  1. After some searching and trying, I offer three different solutions here.

The first solution: (strongly not recommended!) , don't try it, it's easy to be scolded. . . . .

  1. There is a problem with this dependency, right? Just get rid of him! Whoever has a problem solves it!

  2. The specific solution is as follows: Exclude this jdk.toolsdependency!

    <dependency>
        <groupId>org.apache.hbase</groupId>
        <artifactId>hbase-client</artifactId>
        <version>1.3.1</version>
        <exclusions>
            <exclusion>
                <artifactId>jdk.tools</artifactId>
                <groupId>jdk.tools</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    

The second solution: (I tried it, it can be solved but I didn't use it!)

  1. Manually install ** tools.jar** to the local repository:

    mvn install:install-file -DgroupId=jdk.tools -DartifactId=jdk.tools -Dpackaging=jar -Dversion=1.6 -Dfile=tools.jar -DgeneratePom=true
    
    <dependency>
        <groupId>jdk.tools</groupId>
        <artifactId>jdk.tools</artifactId>
        <scope>system</scope>
        <systemPath>${
          
          java.home}/../lib/tools.jar</systemPath>
    </dependency>
    

The third solution: change the JDK version

  1. Refer to the second solution. Doesn’t he need a tools.jarpackage? Give it to him!
  2. Look at this picture! , version 1.8 is available!

insert image description here

  1. However, there is no reason for the jdk11 version tool.jar(I deleted it after trying the second solution)

insert image description here

Guess you like

Origin blog.csdn.net/qq_43408367/article/details/128693393