Closed jferard closed 6 years ago
There are some visitors probably trying to solve the same problem. Here's a summary of the solution.
First mvn dependency:tree
to find which lib needs com.sun.tools:jar
:
\- org.apache.odftoolkit:simple-odf:jar:0.8.2-incubating:compile
[INFO] \- org.apache.odftoolkit:odfdom-java:jar:0.8.11-incubating:compile
[INFO] +- org.apache.odftoolkit:taglets:jar:0.8.11-incubating:compile
[INFO] | \- com.sun:tools:jar:1.7.0:system
Second, check the POM for taglets
. You'll find the dependency. Luckily, the dependency is add by a profile activation:
<profiles>
<profile>
<id>tools.jar</id><!-- For JDK 7 and later - with Oracle Brand -->
<activation>
<property>
<name>java.vendor</name>
<value>Oracle Corporation</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.7.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
<profile>
<id>tools-sun.jar</id><!-- For JDK 6 and OpenJDK - with Sun Brand -->
<activation>
<property>
<name>java.vendor</name>
<value>Sun Microsystems Inc.</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
Three, set a property yo deactivate those two profiles:
<properties>
<java.vendor>prevent odftoolkit from messing the build</java.vendor>
</properties>
This is a dirty hack, but it works!
After Ubuntu upgrade, I got the following error:
After some digging, JRE was update to version 11, which does not know
tools.jar
(modularity). Workaround on linux:Should update README.