openjdk 8:错误 - 找不到文档的公共或受保护类

时间:2017-11-15 15:47:26

标签: java swing debian javadoc openjdk

我在Debian上,已经安装了OpenJDK 8以及包openjdk-8-docdefault-jdk-doc;但是,每当我为JDK 8 API实用程序指定类或程序包名称时,我都无法查看javadoc类的任何文档,该实用程序无法显示文档引发以下错误:

  1. ArrayList案例:

    kais@debian:~$ javadoc ArrayList
    Loading source files for package ArrayList...
    javadoc: warning - No source files for package ArrayList
    Constructing Javadoc information...
    javadoc: warning - No source files for package ArrayList
    javadoc: error - No public or protected classes found to document.
    1 error
    2 warnings
    kais@debian:~$ javadoc java.lang.ArrayList
    Loading source files for package java.lang.ArrayList...
    javadoc: warning - No source files for package java.lang.ArrayList
    Constructing Javadoc information...
    javadoc: warning - No source files for package java.lang.ArrayList
    javadoc: error - No public or protected classes found to document.
    1 error
    2 warnings
    
  2. JPanel案例:

    kais@debian:~$ javadoc JPanel
    Loading source files for package JPanel...
    javadoc: warning - No source files for package JPanel
    Constructing Javadoc information...
    javadoc: warning - No source files for package JPanel
    javadoc: error - No public or protected classes found to document.
    1 error
    2 warnings
    kais@debian:~$ javadoc javax.swing.JPanel
    Loading source files for package javax.swing.JPanel...
    javadoc: warning - No source files for package javax.swing.JPanel
    Constructing Javadoc information...
    javadoc: warning - No source files for package javax.swing.JPanel
    javadoc: error - No public or protected classes found to document.
    1 error
    2 warnings
    kais@debian:~$ javadoc javax.swing
    Loading source files for package javax.swing...
    javadoc: warning - No source files for package javax.swing
    Constructing Javadoc information...
    javadoc: warning - No source files for package javax.swing
    javadoc: error - No public or protected classes found to document.
    1 error
    2 warnings
    
  3. 这在我看来很奇怪,因为已安装的软件包openjdk-8-doc应该包含javadoc所需的文档。

    有什么想法吗?

1 个答案:

答案 0 :(得分:3)

Javadoc工具应该用Java源创建Javadoc。它不是显示特定类的javadoc的工具。 JVM中的类的Javadoc可以在Oracle下载,也可以浏览online

正如你在问题中所说,你已经安装了#34;您的相应JDK的文档,因此您可以更改为"安装目录"而不是再次下载或在线浏览它。 doc-package并打开应该存在的index-html文件。