You are not logged in.

#1 2020-02-14 17:04:16

GTP
Member
Registered: 2016-10-22
Posts: 4

Maven javadoc plugin fails to find javadoc

Hello everyone.
I'm trying to build a Java project that uses Maven as build system, but it fails with the following error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.1.1:javadoc (create-javadocs) on project apache-james-mpt-antlib: An error has occurred in Javadoc report generation: Unable to find javadoc command: The environment variable JAVA_HOME is not correctly set. -> [Help 1]

What I find strange is that javadoc is in my path because if I try to run it i get:

$ javadoc
javadoc: error - No modules, packages or classes specified.
1 error

and I never needed to set java home, I've always used archlinux-java as explained in the wiki to set the default Java environment. Since I found no mention of setting JAVA_HOME in the wiki I'm unsure about setting it since it may not be the right way to fix this issue, at least on Arch. What should I do?
Thanks for your help

Offline

#2 2020-02-16 11:44:09

GTP
Member
Registered: 2016-10-22
Posts: 4

Re: Maven javadoc plugin fails to find javadoc

I've temporarily fixed this by manually setting JAVA_HOME to /usr/lib/jvm/java-11-openjdk since the project I was compiling uses java 11, but I still don't feel like this is the right solution since javadoc also appears in other java version's directories so which javadoc should be used may depend upon the Java version you're using. Maybe archlinux-java should also set JAVA_HOME when changing the default Java environment?

Offline

Board footer

Powered by FluxBB