gpt4 book ai didi

javadoc - 链接到现有 javadoc 仅适用于 Java 平台包

转载 作者:太空宇宙 更新时间:2023-11-04 12:01:57 24 4
gpt4 key购买 nike

我在一个名为 test.java 的文件中找到了这个类:

import java.nio.ByteBuffer;
import io.netty.buffer.ByteBuf;

public class test {
public ByteBuffer x;
public ByteBuf y;
}

我像这样生成 javadoc:

javadoc -link http://docs.oracle.com/javase/7/docs/api/ -link http://netty.io/4.0/api/ test.java

仅创建指向 Java 平台包中的类的链接,没有指向 Netty 或我尝试过的其他包中的类的链接:

Javadocs with link option

如何让 javadoc 也创建到其他包的链接?

<小时/>

在 javadoc 的手册页上,它说唯一真正需要的文件是 package-list 文件:

The Javadoc tool reads the package names from the package-list file and then links to those packages at that URL. When the Javadoc tool is run, the extdocURL value is copied literally into the links that are created.

对于这两个链接,这些文件都存在:

在不提供任何链接的情况下生成 javadoc 时可能相关:

javadoc test.java

同样,它只显示 Java 平台包的包名称:

Javadocs without link option

最佳答案

您收到任何 javadoc 警告/错误吗?

就我而言,我看到:

$ javadoc -link http://docs.oracle.com/javase/7/docs/api/ -link http://netty.io/4.0/api/ test.java
Loading source file test.java...
Constructing Javadoc information...
test.java:2: error: package io.netty.buffer does not exist
import io.netty.buffer.ByteBuf;
^
test.java:6: error: cannot find symbol
public ByteBuf y;
^
symbol: class ByteBuf
location: class test
Standard Doclet version 1.8.0_111

如果我将 netty jar 添加到 javadoc 的类路径中,错误就会消失,并且我构建的 javadoc 包含指向 ByteBuf 的链接:

$ javadoc -cp netty-4.0.42.Final/jar/all-in-one/netty-all-4.0.42.Final.jar -link http://docs.oracle.com/javase/7/docs/api/ -link http://netty.io/4.0/api/ test.java                      
Loading source file test.java...
Constructing Javadoc information...
Standard Doclet version 1.8.0_111
Building tree for all the packages and classes...

关于javadoc - 链接到现有 javadoc 仅适用于 Java 平台包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40820851/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com