1

I am on Mac and trying to generate Cobertura code coverage report but I am getting Could not find artifact com.sun:tools:jar:0 at the specified path /usr/local/Cellar/openjdk/15.0.2/libexec/openjdk.jdk/Content/Home/../lib/tools.jar

which is similar to [https://stackoverflow.com/questions/5616318/how-do-you-address-the-issue-of-a-missing-tools-jar-in-a-jdk-in-mac-os-x].

The weird thing is that when I go to: /Library/Java/JavaVirtualMachines/jdk-11.0.6.jdk/Contents/Home/lib, I still cannot see tools.jar.

Secondly, I am not sure why the the error is showing 15.0.2 while the JVM has 11.0.6

harry123
  • 760
  • 1
  • 7
  • 22
  • `tools.jar` hasn't existed for some time (JDK 9?). You appear to have multiple JDKs, which is fine, but it looks like there's some confusion about which one is actually being used. – Dave Newton Mar 30 '21 at 15:17
  • or (the version of) Cobertura does not support Java 9 or later, and so expects/needs `tools.jar` –  Mar 30 '21 at 15:30
  • @DaveNewton You are right. How can I avoid tools.jar being called? Also, interestingly I do not have cobertura plugin in my pom.xml as well. – harry123 Mar 30 '21 at 16:22
  • @user15244370 I would personally like to avoid tools.jar because the `mvn cobertura:cobertura` will be running on jenkins and I do not want to go around adding it there. – harry123 Mar 30 '21 at 16:23
  • I am just (trying to) saying that apparently the used version of cobertura does not run on newer version of java - use older Java version (like 8) or, maybe there is a version of cobertura that works with newer Java versions –  Mar 30 '21 at 16:27

0 Answers0