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