Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exit code: 1 - javadoc: error - The code being documented uses modules but ...... are in the unnamed module

Local Java Version is :

java version "11.0.7" 2020-04-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.7+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.7+8-LTS, mixed mode)

but my project having java version of :

<java.version>1.8</java.version>

During the build I am getting an error :

Exit code: 1 - javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module.

How to solve without changing java version of pom to Java 11 or downgrading to Java 8?

like image 465
Remo Avatar asked Jun 23 '20 09:06

Remo


1 Answers

I believe you might just have faced a relevant JDK issue - JDK-8212233 and also related to JDK-8217177

To solve that, one of the recommendations would be to upgrade the JDK, since the fix doesn't look to me as backported to JDK-11 while going through the comments. But yeah, your current version could just be the one impacted.

Ensure, updating the configuration of the Javadoc plugin to

<configuration>
  <source>8</source>
</configuration>
like image 71
Naman Avatar answered Sep 28 '22 09:09

Naman