Support Java 9+
kicasta opened this issue · 2 comments
Hi,
calling "site" with Java 9+ fails with the attached exception, with java 8 however works fine. Is there a workaround?
Thanks in advance
Attachment
Hello @kicasta, thanks for reporting the issue.
I've been checking how to fix that but it's a very complicated one since the tools.jar
that provides the Doclet API (package com.sun.javadoc
) was removed in Java 9 (jigsaw).
A completely new API that doesn't rely on this tools.jar
was introduced.
The Doclet API was moved from package com.sun.javadoc
to jdk.javadoc.doclet
in Java 9+.
Furthermore, now we have different classes and interfaces, making this new Doclet API completely incompatible with the Java 8 one.
So, to support Java 9+ it would be required to branch the source tree in two different projects that are difficult and time-consuming to maintain. Another approach is to change the sources to create a single project compatible with Java 8 and Java 9+, using the multi-release jar feature [1] [2]. However, this would require a complete redesign of the project.
In this particular case, it's not just a matter of configuration (as pointed here), because the public interface of the Doclet API was completely redesigned.
The pre-Java 9 Doclet API was a complete mess and needed to be redesigned.
But unfortunately, I won't be able to perform such changes in the short term.
Anyway, even if you have a Java 9+ project, you should be able to run the Coverage Doclet using JDK 8. The best way to switch the JDK version is using sdkman, so that you can use a specific JDK at the command line to build the project. This is useful when you want to achieve a defined goal such as computing the JavaDoc coverage.
Hi @manoelcampos ,
thanks for the repply and meaningful explanation.