Missing artifact sun.jdk: tools: jar: 1.6.0: system

im using mac and saw this error in one of my pom files. I googled around and added the following section to pom.xml:

<profiles> <profile> <id>osx</id> <activation> <os> <family>mac</family> </os> </activation> <properties> <toolsjar>${java.home}/../Classes/classes.jar</toolsjar> </properties> </profile> </profiles> ... <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.6.0</version> <scope>system</scope> <systemPath>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar</systemPath> </dependency> ... 

then when I started

 mvn clean install -Posx 

I still got the same error. please, help!

+1
source share
1 answer

Use the command below to install tools.jar from your installed JDK location to the maven repository.

 $mvn install:install-file -DgroupId=sun.jdk -DartifactId=tools -Dpackaging=jar -Dversion=1.6 -Dfile=C:\Program Files\Java\jdk1.6.0_27\lib\tools.jar 

Note. Make sure the JDK has set the path in the above command.

+1
source

Source: https://habr.com/ru/post/1204912/


All Articles