简体   繁体   中英

Maven project couldn't compile due to missing tools.jar, in mac

The problem is pretty much the same as listed here: JDK tools.jar as maven dependency

But I have tried all of the solutions, none of them works for me. All of them says

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]

Through my early googling, it seems in mac it is replaced by classes.jar. I tried to change java_home to "..../Contents/", error remains as ".../Contents/Home/../lib/tools.jar"

I am new to Maven and am following this tutorial to build a simple REST WS with Spring: http://spring.io/guides/gs/rest-service/

You can add tools.jar as dependency in POM.xml , with "scope"= "system" and "systemPath" equals to "/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/tools.jar "

Hope this helps

Regards

Jyotsna

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM