【发布时间】:2017-11-02 20:29:54
【问题描述】:
问题与此处列出的几乎相同: 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/
【问题讨论】:
-
在我的机器上,
tools.jar位于/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/tools.jar,这使得问题中的文件位置成为问题。你在哪里定义tools.jar的路径? -
在 spring 示例中没有给出对 tools.jar 的引用?为什么需要它?
-
@Peter Liljenberg,我使用的是 OSX,没有 tools.jar,而是使用 classes.jar,请参见此处:developer.apple.com/library/mac/documentation/java/conceptual/…
-
@khmarbaise,spring-boot-maven-plugin 使用 tools.jar 作为其依赖项
-
@user3414824 我也在使用 OsX,而且我有一个 tools.jar,这就是我要问的原因。猜猜你正在运行 Java6 或者刚刚安装了 JRE