JDK 11+和Javadoc [英] JDK 11+ and Javadoc

查看:424
本文介绍了JDK 11+和Javadoc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

有人能够使javadoc工作而不必将源版本更改为1.8(如其他论坛中所建议的那样)吗?我使用的是JDK v11.0.5,问题仍然存在(JDK 12+也是如此).

Has anyone been able to make javadoc work without having to change the source version to 1.8 (as suggested in other forums)? I'm using JDK v11.0.5 and the issue still present (also with JDK 12+).

此错误起源于maven,由maven-javadoc-plugin抛出.即使使用<source>8</source>配置,我也无法使其适用于JDK 11+.

This error originated from maven and thrown by the maven-javadoc-plugin. I have not been able to make it work for JDK 11+ even with the <source>8</source> configuration.

推荐答案

在OpenJDK中建议问题跟踪器,可以通过在Javadoc插件上定义源来解决:

As suggested in OpenJDK issue tracker this can be worked around with defining source on Javadoc plugin:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <configuration>
        <source>8</source>
    </configuration>
</plugin>

这篇关于JDK 11+和Javadoc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆