javadoc命令用于生成类似标准Java API的注释文档。
1. javadoc可以识别的注释
@author
@version
@since
@param
@throws
package com.langtao.base;
/**
* @author langtao
* @version 1.0
* @since 1.8
*/
public class Doc {
String name = "";
/**
* @author langtao
* @return
* @throws Exception
*/
public String test() throws Exception {
return name;
}
}
2. 使用命令行生成java
javadoc Doc.java
![](https://www.icode9.com/i/l/?n=20&i=blog/2188071/202011/2188071-20201107231820990-1826436809.png)
![](https://www.icode9.com/i/l/?n=20&i=blog/2188071/202011/2188071-20201107232033632-278929014.png)
3. 在IDEA中生成javadoc
Tools--->Generate JavaDoc
![](https://www.icode9.com/i/l/?n=20&i=blog/2188071/202011/2188071-20201107232250057-2095851621.png)