In the pom.xml for a java project, I get missing artifact jdk.tools:jdk.tools:jar:1.6 error

后端 未结 7 962
执念已碎
执念已碎 2021-02-05 05:20

I think I know how to solve the problem except: I don\'t know where in the pom the specific version is referred to (I do not see it explicitly) and the solution I have seen is t

7条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-05 06:21

    For anyone who stumbles over this issue in the future, read on for a more elegant solution:

    Reason

    This issue crops up in one of the two scenarios:

    1. You do not have JDK installed and configured; or

    2. You've both JDK and JRE installed and JRE is getting precedence over the JDK path.

    Solution

    As explained in this link by the team at 'Hadoop in the real world', you merely need to add the dependency to tools.jar in your pom.xml file.

    
    jdk.tools
    jdk.tools
    1.7.0_05
    system
    ${JAVA_HOME}/lib/tools.jar
    
    

    If the error persists, then just change the path to tools.jar to an absolute path as shown below:

    C:/Program Files/Java/jdk1.8.0_65/lib/tools.jar
    

提交回复
热议问题