Specify the reference directly in pom.
<! -- The tool. Jar cannot be found after Struts-core is imported. -->
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
If the system environment variable java_home is not configured, you must configure it in advance. The advantage is that JDK can be directly used as long as the client is configured. You can also specify the JDK installation directory.
<properties>
<java.home>D:/Java/jdk1.6.0_43</java.home>
</properties>
Replace $ {java_home} with $ {java. Home. This java. Home is a variable defined in Maven. The bad thing about this method is that if the machine is changed, the JDK location cannot be guaranteed.
Another method is to copy the tools. jar file under JDK to the project, and then specify. This method is not limited by machines.
Missing artifact com. Sun: Tools: jar: 1.5.0