Cause of the problem:
The Maven plugin in eclipse does not reference environment variables by default, so the path to the JDK cannot be found, and Tool.jar is not found.
Workaround:
The steps are as follows:
1. Close Eclips
2. Locate the Eclipse.ini file under the same folder as the Eclipse startup icon in the Extract directory of Eclipse, and add the-vmargs above the file
-vm
C:\Program Files\java\jdk1.7.0_79\jre\bin\server\jvm.dll
Note: The second line of C:\Program files\java\jdk1.7.0_79 is replaced with its own JDK path.
:
3. Save the Eclipse.ini file.
4. Reopen Eclipse.
5. After the above four steps, in some cases, the problem will be successfully resolved, in some cases, the problem is still unresolved, then do not worry, then open the MAVEN project Pom.xml file, plus
<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.7.0_05</version>
<scope>system</scope>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
Note: If the JDK version you installed is not 1.7.0_05, please replace it with your own version
:
6. Save all the files, if the above steps down strictly, the problem here should be solved perfectly!
Address the issue of missing artifact sun.jdk:tools:jar:1.5.0, the first time to build a project like Hadoop using Maven in eclipse