[
https://issues.apache.org/jira/browse/MJAVADOC-650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17193727#comment-17193727
]
Benjamin Marwell commented on MJAVADOC-650:
-------------------------------------------
[~evanward] thanks for your in-depth explanation. I see now what is going on
here. My fault was to imply "the binary has been relocated" when you in fact
wrote:
{quote}Java 9 changed the directory structure of the JDK and JRE so [1] no
longer finds the javadoc command.
{quote}
Sorry for that and thanks for explaining.
I just wonder why this never fails for me (nor a lot of other people). Maybe
not setting the environment variable {{JAVA_HOME}} OR setting {{JRE_HOME}}
will result in this behaviour. The official documentation is in fact:
{quote}"java.home" Installation directory for Java Runtime Environment
(JRE)"java.home" Installation directory for Java Runtime Environment (JRE)
{quote}
But it does not state that this is a "jre" folder, which is what you said.
What actually brought me of track was this comment in the patch you attached a
link to:
{quote}// On Java 9, this has moved to:
/usr/lib/jvm/java-9-openjdk-amd64/bin/javadoc
{quote}
Well, it was never moved. The java binary was moved from {{jdk/jre/bin/java}}
to {{jdk/bin/java}} and {{java.home}} was moved from {{jdk/jre}} to just
{{jdk}} if you will. This will also explain why I never had the problem – if
the file does not exist and {{JAVA_HOME}} env var is set, that one will be
used, [see these
lines|[https://github.com/apache/maven-javadoc-plugin/blob/master/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java#L3811-L3826]].
I think the patch is just fine the way it is, just the comment is a bit
misleading or could use some rephrasing. Would you like to create a pull
request?
> Fix Javadoc search path for Java 9+
> -----------------------------------
>
> Key: MJAVADOC-650
> URL: https://issues.apache.org/jira/browse/MJAVADOC-650
> Project: Maven Javadoc Plugin
> Issue Type: Bug
> Affects Versions: 3.2.0
> Reporter: Evan Ward
> Priority: Major
>
> Hi,
> Java 9 changed the directory structure of the JDK and JRE so [1] no longer
> finds the javadoc command. Debian has a patch to fix this at [2]. It's only a
> few lines. Please apply the patch or implement the capability to look for
> `./bin/javadoc` as well as `../bin/javadoc`.
> Thanks,
> Evan
>
> [1]
> [https://github.com/apache/maven-javadoc-plugin/blob/master/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java#L3805]
> [2]
> [https://sources.debian.org/data/main/m/maven-javadoc-plugin/3.0.1-3/debian/patches/openjdk-9-javadoc-path.patch]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)