2

The cobertura-maven-plugin version 2.7 complains not to find tools.jar! The log tells me that the plugin is searching com.sun.tools.jar at specified path C:\Program Files\Java\jdk-10.0.1/../lib/tools.jar! Of course at this location no tools.jar can be found. I declared the dependency of tools.jar within the pom, which results within the effective pom as:

        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.8.0</version>
          <scope>system</scope>
          <systemPath>C:\PROGRA~1\Java\jdk1.8.0_172\lib\tools.jar</systemPath>
        </dependency>

This SystemPath is correct. Nowhere in my declarations I can find a declaration of tools.jar being under jdk-10 directory. So the source of the issue my be in the corbertura maven plugin. Does anybody know more about this?

juerg
  • 381
  • 4
  • 18
  • You installed JRE not JDK, install different package. Also your path points to jdk1.8 not jdk10. – agilob May 02 '18 at 13:38
  • 2
    Starting with JDK 9 a tools jar does not exist anymore...Apart from that I would recommend to use JaCoCo instead of cobertura... – khmarbaise May 02 '18 at 13:55
  • @agilob Please read before comment! – juerg May 02 '18 at 15:34
  • @khmarbaise. With JaCoCo you may be rigth. w.r.t. to tools.jar you should read better. cobertura is searching the file under jdk-10, though I tried to override this by declaring the path to the jdk-8. Both are installed on the system. – juerg May 02 '18 at 15:39
  • Sorry but this does not make sense to use a tools.jar of JDK 8 in a build with JDK 10 (I read at the beginning)....as I already mentioned go to JaCoCo or maybe you could try [OpenClover](http://openclover.org/)...but a mixture of different JDK versions is... sorry to say that: an invitation for having trouble...furthermore instrumentation in JDK 9 will not work...and might produce invalid class files! Apart from that all above a system scoped dependency is also a bad idea...which is not portable in any way... – khmarbaise May 02 '18 at 15:48
  • The problem is related to cobarture and the path to tools.jar was included only to satisfy cobarture! The application is compiled with and against jdk10. The question was related only to the strange behavior of cobarture to search tools.jar under jdk10, even nowhere in the application such a path is given. The aim of the question was to know if somebody out there knows more about such issues. dot. Anyway cobarture can neither handle java lambda. Obviously no maintenance is done anymore, which makes any further question related to this tool obsolete. – juerg May 03 '18 at 18:19

0 Answers0