Is it possible to auto-generate Javadoc comments for each method in one class in IntelliJ IDEA?
Asked
Active
Viewed 8.7k times
3 Answers
44
Yes.
Under Tools
you have Generate JavaDoc
. Read about it in the official site.
In addition you may (Intellij 15):
Position caret above a method name, type /** and press Enter to let IntelliJ IDEA automatically generate JavaDoc stubs for this method
Edit: You can use the action Fix doc comment
. It doesn't have a default shortcut, but you can assign the Alt+Shift+J shortcut to it in the Keymap, because this shortcut isn't used for anything else.

Idos
- 15,053
- 14
- 60
- 75
-
didn't work for me. Is there any shortcut such as in eclipse shift+alt+j – Madan Feb 14 '16 at 08:33
-
@Madan what do you mean by *didn't work*? Did you read https://www.jetbrains.com/idea/help/generate-javadoc-dialog.html ? Also see my **Edit** – Idos Feb 14 '16 at 08:36
-
2I mean Positioning caret above a method name and typing /** didn't worked . I made assigned shortcut and worked for me thanks... :-) – Madan Feb 14 '16 at 09:00
-
1did you press Enter – drez90 Oct 26 '17 at 22:06
-
4I think the question is not how to generate JavaDoc from existing source, rather how to add JavaDoc comments to source files. If my understanding is correct, then please refer to this question – Tomas Dec 16 '17 at 18:45
-
1How to generate bulk comments for entire module. Keep in mind that I am not asking about Java Doc. I am asking about method/class doc comments. – Chintan Pandya Sep 16 '19 at 10:17
-
1For `Java`, install `JavaDoc` plugin and for `Kotlin`, install `KDoc` plugin under `File -> Settings -> Plugins -> type the plugin name in search bar` for this solution to work correctly. – Îsh Jan 05 '21 at 19:57
7
You can use JavaDoc plugin for generation JavaDoc comments in batch mode. It is the simpliest way for do it.

AlexanderRS
- 359
- 2
- 9