I'm trying to run the maven verify
command but getting this error.
MavenReportException: Error while generating Javadoc: Unable to find javadoc command: The environment variable JAVA_HOME is not correctly set.
Maven cannot find the javadoc
command so it cannot create the documentation.
The interesting part is that I can run the mvn javadoc:jar
command and it successfully works. Besides my JAVA_HOME
is points to the correct location.
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home
This is from the pom file.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
<executions>
<execution>
<id>attach-javadoc</id>
<phase>verify</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
Please don't tell me this is the duplicate of the question Unable to find javadoc command - maven. I know the problem is the same but our situations are different and my JAVA_HOME
points to the right location. So that solution doesn't work for me.