In my Maven build I have a dependency on the tools.jar;
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.8.0</version>
<scope>system</scope>
<systemPath>${toolsjar}</systemPath>
</dependency>
where the toolsjar
is defined as a property:
<toolsjar>${java.home}/../lib/tools.jar</toolsjar>
This all works well on Linux and Windows systems. However on a Mac the path is not properly resolved:
java.home: /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre
resolved property value: /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/tools.jar
actual location: /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/lib/tools.jar
As you can see the tools.jar
is searched in the lib
folder of the jre
instead of the jdk
. However the path is properly specified.
Any idea why this does not work as expected, or how to fix it?