This reference explained how to include tools.jar
in the dependencies.
But I don't know where should I insert that code to?
Should I insert it to the setting.xml
of Maven or the pom.xml
of my Java project?
I used the default maven in Eclipse 4.5.2(Mars.2 Release in Win7).
I want to include tools.jar
in my project.
I could use the following code to include it in the pom.xml
.
<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<scope>system</scope>
<version>1.4.2</version>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
I also want to try to use java.home
, not JAVA_HOME
.
I only know that they are different, but I don't exactly know the differences between them.
After reading that reference, I want to try it out. But I failed.
So how should I use java.home
to configure the pom.xml
file to include tools.jar
?
UPDATE:
I could reference java.home
like this:
<project ...>
...
<properties>
<java.home>D:\Program Files\Java\jdk1.6.0_45</java.home>
</properties>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.4.2</version>
<scope>system</scope>
<systemPath>${java.home}/lib/tools.jar</systemPath>
</dependency>
</dependencies>
</project>