How can I generate Javadoc comments in Eclipse?

JavaEclipseJavadoc

Java Problem Overview


Is there a way to generate Javadoc comments in Eclipse? If so, what is it?

Java Solutions


Solution 1 - Java

For me the /**<NEWLINE> or Shift-Alt-J (or --J on a Mac) approach works best.

I dislike seeing Javadoc comments in source code that have been auto-generated and have not been updated with real content. As far as I am concerned, such javadocs are nothing more than a waste of screen space.

IMO, it is much much better to generate the Javadoc comment skeletons one by one as you are about to fill in the details.

Solution 2 - Java

Shift-Alt-J is a useful keyboard shortcut in Eclipse for creating Javadoc comment templates.

Invoking the shortcut on a class, method or field declaration will create a Javadoc template:

public int doAction(int i) {
	return i;
}

Pressing Shift-Alt-J on the method declaration gives:

/**
 * @param i
 * @return
 */
public int doAction(int i) {
	return i;
}

Solution 3 - Java

JAutoDoc: > an Eclipse Plugin for automatically adding Javadoc and file headers to your source code. It optionally generates initial comments from element name by using Velocity templates for Javadoc and file headers...

Solution 4 - Java

You mean menu Project -> Generate Javadoc ?

Solution 5 - Java

At a place where you want javadoc, type in /**<NEWLINE> and it will create the template.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionantony.trupeView Question on Stackoverflow
Solution 1 - JavaStephen CView Answer on Stackoverflow
Solution 2 - JavacoobirdView Answer on Stackoverflow
Solution 3 - Javaantony.trupeView Answer on Stackoverflow
Solution 4 - JavaMirek PlutaView Answer on Stackoverflow
Solution 5 - JavabmarguliesView Answer on Stackoverflow