问题与此处列出的几乎相同: JDK tools.jar as maven dependency
但是我已经尝试了所有解决方案,但它们都不适合我。所有人都说
ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.0.0.RC4:run (default-cli) on project gs-rest-service: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:1.0.0.RC4:run failed: Plugin org.springframework.boot:spring-boot-maven-plugin:1.0.0.RC4 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.6 at specified path /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../lib/tools.jar -> [Help 1]
通过我早期的谷歌搜索,似乎在mac中它被classes.jar取代。 我试图将java_home更改为“.... / Contents /”,错误仍然是“... / Contents / Home /../ lib / tools.jar”
我是Maven的新手,我正在按照本教程使用Spring构建一个简单的REST WS: http://spring.io/guides/gs/rest-service/
答案 0 :(得分:1)
您可以在POM.xml中添加tools.jar作为依赖项,“scope”=“system”和“systemPath”等于“/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib /tools.jar“
希望这有帮助
此致
Jyotsna