[ 
https://issues.apache.org/jira/browse/MJAVADOC-650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17193704#comment-17193704
 ] 

Evan Ward commented on MJAVADOC-650:
------------------------------------

Hi [~bmarwell],

I don't think were having a good conversation with mutual understanding. If you 
read what I wrote I have never said the location of the javadoc binary has 
changed. Also I have never implied that there ever existed a javadoc executable 
within the JRE.

Please read the links I provided. Specifically the linked code in maven where 
the comments state:

 
{code:java}
        // 
----------------------------------------------------------------------
        // Try to find javadocExe from System.getProperty( "java.home" )
        // By default, System.getProperty( "java.home" ) = JRE_HOME and JRE_HOME
        // should be in the JDK_HOME
        // 
----------------------------------------------------------------------
{code}
That assumption, which the code makes, was invalidated when Java 9 removed the 
`jre` directory. That is the faulty assumption that needs to be fixed. That is 
the assumption that is fixed by the attached patch. It is not Debian specific, 
it applies to all implementations of the JDK. To quote the Oracle release notes 
[1] for JDK 9:

 
{quote}After you install JDK 9, if you look at the file system, you’ll notice 
that the directory layout is different from that of previous releases.

Prior releases produced two types of runtime images: the JRE, which was a 
complete implementation of the Java SE Platform, and the JDK, which included 
the entire JRE in a {{jre/}} directory, plus development tools and libraries.
{quote}
 

Regarding your questions:

I have never set $JAVA_HOME.  When $JAVA_HOME is not set Java determines it own 
installation directory. This is the process that has changed between 8 and 9, 
not the location of the javadoc binary. Try running `find . -name 'java'` in 
your JDK zoo. You will find that in in versions before 9 there is a java 
executable in `jre/bin/java` instead of just the `bin/java` in newer JDKs. 
Before 9 Java determined its installation directory to be the `jre` directory 
so that is the path returned by `System.getProperty("java.home")`. That changed 
with 9 when the Java project deleted the `jre` directory from the JDK.

I've tested with the JDK's shipped with Ubuntu and with Adopt OpenJDK JDKs. 
They all have the same results. I've tested with the Ubuntu provide maven and 
with the Apache provided maven. They all have the same results.

[1] 
[https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-D867DCCC-CEB5-4AFA-9D11-9C62B7A3FAB1]

 

> 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)

Reply via email to