Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pom.xml project build error

I have imported maven projects in my eclipse, but I am getting the following error in pom.xml-

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

I am kind of new to maven, any help will be appreciated.

like image 941
Y0gesh Gupta Avatar asked Dec 26 '22 17:12

Y0gesh Gupta


1 Answers

You've specified a dependency on jdk.tools:jdk.tools:jar with a <systemPath> of ${JAVA_HOME}/lib/tools.jar. ${JAVA_HOME} is not a valid Maven property. The syntax to read the environment variable JAVA_HOME is ${env.JAVA_HOME}. However, the same information is exposed as a system property named java.home, so ${java.home} is the best solution.

like image 110
Sam Hanes Avatar answered Dec 28 '22 11:12

Sam Hanes