Hello,

I have a Jenkins 2.190.2 running.

I specified a custom JDK with "JAVA_HOME" set to `/opt/jdk8` which itself is a 
symbolic link to `/opt/oracle_jdk1.8.0_191`.

Some of my maven builds are now breaking due to the javadoc executable not 
being found:


[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-javadoc-plugin:3.1.1:jar (default-cli) on 
project XXX: MavenReportException: Error while generating Javadoc: Unable to 
find Javadoc command: The Javadoc executable 
'/opt/oracle_jdk1.8.0_191/jre/bin/javadoc' doesn't exist or is not a file. 
Verify the <javadocExecutable/> parameter.


Of course `Javadoc` cannot be found when searching in $JAVA_HOME/jre.
Why is Jenkins referring to the jre subdirectory? When calling maven with the 
-X parameter I see that jenkins actually calls maven with `/opt/jdk8/bin/java`, 
but then sets the Java home to `/opt/oracle_jdk1.8.0_191/jre`:


[XXX] $ /opt/jdk8/bin/java -cp 
/home/Jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.13.jar:....
...
Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: 
/opt/oracle_jdk1.8.0_191/jre


I know that I could forcibly set the `<javadocExecutable/>` parameter to 
`${java.home}../bin/javadoc`, but that would be wrong, since $JAVA_HOME is 
/opt/jdk8, not /opt/jdk8/jre and it would break the build for all other cases 
than Jenkins.

So how can I force Jenkins to use the correct $JAVA_HOME for building?

BR
Marco

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/AM0PR10MB31079EBED16FBFD216C46DB2E0740%40AM0PR10MB3107.EURPRD10.PROD.OUTLOOK.COM.

Reply via email to