Pom.xml project build error

不打扰是莪最后的温柔 提交于 2019-12-10 20:32:15

问题


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.


回答1:


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 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.




回答2:


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.



来源:https://stackoverflow.com/questions/19921311/pom-xml-project-build-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!