
Question:
I have imported maven projects in my eclipse, but I am getting the following error in pom.xml-
<blockquote>Project build error: 'dependencyManagement.dependencies.dependency.systemPath' for jdk.tools:jdk.tools:jar must specify an absolute path but is ${JAVA_HOME}/lib/tools.jar
</blockquote>I am kind of new to maven, any help will be appreciated.
Answer1:You've specified a dependency on jdk.tools:jdk.tools:jar
with a <systemPath>
of ${JAVA_HOME}/lib/tools.jar
. ${JAVA_HOME}
isn't a valid <a href="http://books.sonatype.com/mvnref-book/reference/resource-filtering-sect-properties.html" rel="nofollow">Maven property</a>. The syntax to read the environment variable JAVA_HOME
is ${env.JAVA_HOME}
. However, the same information is exposed as a <a href="http://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html" rel="nofollow">system property</a> named java.home
, so ${java.home}
is the best solution.
Look for tools.jar
which should be in jdk/lib
, if not mean download latest jdk or add tools.jar
to this location. This should fix the issue.