如何在 Eclipse 中生成 Javadoc HTML 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4468669/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to generate Javadoc HTML files in Eclipse?
提问by JaneNY
I have written Javadoc style comments like this in my project's code:
我在我的项目代码中编写了这样的 Javadoc 样式注释:
/**
* Description...
*
* @param ...
* @return .....
*/
How can I generate Javadoc HTML files using the Eclipse IDE?
如何使用 Eclipse IDE 生成 Javadoc HTML 文件?
回答by Renu P
Project> Generate Javadoc....
In the Javadoc command:field, browse to find javadoc.exe(usually at [path_to_jdk_directory]\bin\javadoc.exe).
Check the box next to the project/package/file for which you are creating the Javadoc.
In the Destination:field, browse to find the desired destination (for example, the root directory of the current project).
Click Finish.
Project> Generate Javadoc....
在该Javadoc command:字段中,浏览以查找javadoc.exe(通常位于[path_to_jdk_directory]\bin\javadoc.exe)。
选中要为其创建 Javadoc 的项目/包/文件旁边的框。
在该Destination:字段中,浏览以找到所需的目的地(例如,当前项目的根目录)。
单击Finish。
You should now be able to find the newly generated Javadoc in the destination folder. Open index.html.
您现在应该能够在目标文件夹中找到新生成的 Javadoc。打开index.html。
回答by pioneerBhawna
This is a supplement answer related to the OP:
这是与OP相关的补充答案:
An easy and reliable solution to add Javadocs comments in Eclipse:
在 Eclipse 中添加 Javadocs 注释的简单可靠的解决方案:
- Go to Help> Eclipse Marketplace....
- Find "JAutodoc".
- Install it and restart Eclipse.
- 转到Help> Eclipse Marketplace...。
- 找到“JAutodoc”。
- 安装它并重新启动 Eclipse。
To use this tool, right-click on class and click on JAutodoc.
要使用此工具,请右键单击类并单击JAutodoc。
回答by Jacob van Lingen
To quickly add a Javadoc use following shortcut:
要快速添加 Javadoc,请使用以下快捷方式:
Windows: alt+ shift+ J
视窗:alt+ shift+J
Mac: ?+ Alt+ J
苹果:?+ Alt+J
Depending on selected context, a Javadoc will be printed. To create Javadoc written by OP, select corresponding method and hit the shotcut keys.
根据选定的上下文,将打印一个 Javadoc。要创建由 OP 编写的 Javadoc,请选择相应的方法并点击快捷键。
回答by Sean Das
You can also do it from command line much easily.
您也可以轻松地从命令行执行此操作。
- Open command line from the folder/package.
From command line run:
javadoc YourClassName.java
To batch generate docs for multiple Class:
javadoc *.java
- 从文件夹/包打开命令行。
从命令行运行:
javadoc 你的类名.java
为多个类批量生成文档:
javadoc *.java