美文网首页
eclipse生成Javadoc

eclipse生成Javadoc

作者: nextliving | 来源:发表于2019-03-08 14:00 被阅读1次

编写java项目

项目名为JavaDoc-demo。项目代码已上传到github的JavaDoc-demo

创建jdoc文件夹

该文件夹用于存放输出的所有Javadoc文件。

生成Java Doc

首先点击eclipse的【Project】菜单,选择【Generate JavaDoc】选项:


Screen Shot 2019-03-08 at 1.38.52 PM.png

选择要输出Javadoc的项目,在【Use standard doclet】部分的选中刚才创建的jdoc文件夹:

Screen Shot 2019-03-08 at 1.42.17 PM.png
点击Finish,会在jdoc中生成Javadoc,eclipse的console部分输出:
Loading source files for package com.ms.service...
Loading source files for package com.ms.entity...
Constructing Javadoc information...
Standard Doclet version 1.8.0_92
Building tree for all the packages and classes...
Generating /Users/chenxin/Desktop/jdoc/com/ms/service/ProductService.html...
Generating /Users/chenxin/Desktop/jdoc/com/ms/entity/Product.html...
Generating /Users/chenxin/Desktop/jdoc/overview-frame.html...
Generating /Users/chenxin/Desktop/jdoc/com/ms/entity/package-frame.html...
Generating /Users/chenxin/Desktop/jdoc/com/ms/entity/package-summary.html...
Generating /Users/chenxin/Desktop/jdoc/com/ms/entity/package-tree.html...
Generating /Users/chenxin/Desktop/jdoc/com/ms/service/package-frame.html...
Generating /Users/chenxin/Desktop/jdoc/com/ms/service/package-summary.html...
Generating /Users/chenxin/Desktop/jdoc/com/ms/service/package-tree.html...
Generating /Users/chenxin/Desktop/jdoc/constant-values.html...
Generating /Users/chenxin/Desktop/jdoc/com/ms/service/class-use/ProductService.html...
Generating /Users/chenxin/Desktop/jdoc/com/ms/entity/class-use/Product.html...
Generating /Users/chenxin/Desktop/jdoc/com/ms/entity/package-use.html...
Generating /Users/chenxin/Desktop/jdoc/com/ms/service/package-use.html...
Building index for all the packages and classes...
Generating /Users/chenxin/Desktop/jdoc/overview-tree.html...
Generating /Users/chenxin/Desktop/jdoc/index-files/index-1.html...
Generating /Users/chenxin/Desktop/jdoc/index-files/index-2.html...
Generating /Users/chenxin/Desktop/jdoc/index-files/index-3.html...
Generating /Users/chenxin/Desktop/jdoc/index-files/index-4.html...
Generating /Users/chenxin/Desktop/jdoc/index-files/index-5.html...
Generating /Users/chenxin/Desktop/jdoc/deprecated-list.html...
Building index for all classes...
Generating /Users/chenxin/Desktop/jdoc/allclasses-frame.html...
Generating /Users/chenxin/Desktop/jdoc/allclasses-noframe.html...
Generating /Users/chenxin/Desktop/jdoc/index.html...
Generating /Users/chenxin/Desktop/jdoc/overview-summary.html...
Generating /Users/chenxin/Desktop/jdoc/help-doc.html...

验证Javadoc

打开jdoc文件夹,会生成下面的文件:

.
├── allclasses-frame.html
├── allclasses-noframe.html
├── com
│   └── ms
│       ├── entity
│       │   ├── Product.html
│       │   ├── class-use
│       │   │   └── Product.html
│       │   ├── package-frame.html
│       │   ├── package-summary.html
│       │   ├── package-tree.html
│       │   └── package-use.html
│       └── service
│           ├── ProductService.html
│           ├── class-use
│           │   └── ProductService.html
│           ├── package-frame.html
│           ├── package-summary.html
│           ├── package-tree.html
│           └── package-use.html
├── constant-values.html
├── deprecated-list.html
├── help-doc.html
├── index-files
│   ├── index-1.html
│   ├── index-2.html
│   ├── index-3.html
│   ├── index-4.html
│   └── index-5.html
├── index.html
├── overview-frame.html
├── overview-summary.html
├── overview-tree.html
├── package-list
├── script.js
└── stylesheet.css

点击打开index.html,会在浏览器中显示下面的内容:

Screen Shot 2019-03-08 at 1.52.53 PM.png

相关文章

网友评论

      本文标题:eclipse生成Javadoc

      本文链接:https://www.haomeiwen.com/subject/vjrrpqtx.html