FIX: Missing artifact jdk.tools:jdk.tools:jar:1.7 issue occurs with Eclipse or STS running MAVEN project

Source: Internet
Author: User

Missing artifact jdk.tools:jdk.tools:jar:1.7 issue with Eclipse or STS running MAVEN project

In recent projects, the big data platform was used, the Hbase-client.0.98.6-hadoop2.jar package was applied in the code, and jdk.tools.1.7 was referenced in the package, so pom.xml in eclipse always prompts missing Artifact jdk.tools:jdk.tools:jar:1.7. Looking for a reason from the Internet, most of them say that the project Maven can't find the jdk1.7 in the system, The root cause is not the location of the specified Javaw.exe, there are three specific solutions, here I prefer the first, because the second and third change Pom.xml file, this is not good, because we re-develop the project code has a lot of people co-development, you change pom file may affect others, so Pom try to have a person Manage and drive people's code as little as possible.

Method One: Modify the Eclipse or STS boot configuration

Locate the installation path for Eclipse or STS, locate Eclipse.ini or Sts.ini under the installation path, open its file, find "-vmargs" in the file, and add the following code before "-vmargs"

-vmd:\tools\java\jdk1.7\jre\bin\server\jvm.dll

Where D:\tools\java\jdk1.7 is replaced with its own java_home path record.

Restart Eclipse or STS after you modify it

Method Two: Add a dependent project directly to the Pom.xml

Add the following configuration in the Pom file

<Dependency>      <groupId>Jdk.tools</groupId>      <Artifactid>Jdk.tools</Artifactid>      <version>1.7</version>      <Scope>System</Scope>      <Systempath>${java_home}/lib/tools.jar</Systempath>  </Dependency>  
Method Three: Specify the JDK in the plugins of the Pom file

Add the following configuration to the MAVEN project Pom file

<Plugins>    <plugin>        <groupId>Org.apache.maven.plugins</groupId>        <Artifactid>Maven-compiler-plugin</Artifactid>        <Configuration>            <Source>1.7</Source>            <Target>1.7</Target>        </Configuration>    </plugin></Plugins>

Fix: Missing artifact jdk.tools:jdk.tools:jar:1.7 problem occurs with Eclipse or STS running Maven project

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.