I am execution a project with Java 6 (latest public Oracle release) and Maven 3.2.5. I want the Javadoc generated with Java 8. When configuring with this setup, everything works fine:
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
...
<javadocExecutable>/usr/lib/jvm/java-8-oracle/bin/javadoc</javadocExecutable>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
However, if I omit the <javadocExecutable>
element and try the same from the command line, it fails (Java 6 is used as reported by Maven):
$ mvn release:prepare -DjavadocExecutable=/usr/lib/jvm/java-8-oracle/bin/javadoc