3

The javadoc plugin generated default javadocs, how to set them ? Where is the Javadoc plugin settings in Intellij Idea ?

enter image description here enter image description here

Raw
  • 615
  • 1
  • 7
  • 22

1 Answers1

4

IntelliJ has built-in support for generating JavaDocs so unless there's something missing from that feature you won't need a plugin.

You can access this feature from Tools > Generate JavaDoc ...

enter image description here

More details in the docs here and here.

Edit 1: Based on your last comment I think you want to create the JavaDocs rather than generate the JavaDoc output. If so, then IntelliJ will create a Javadoc for you when you:

  • Place the caret in an empty line immediately above a method
  • Type /**
  • Hit the ENTER key

Given this method:

public void run(long distance) throws ExtremeFatigueException {

}

The /** + ENTER keystroke combination will generate this skeleton JavaDoc:

/**
 *
 * @param distance
 * @throws ExtremeFatigueException
 */

The format of the JavaDocs in IntelliJ is controlled in Preferences > Editor > Code Style > Java then click on the JavaDoc tab.

glytching
  • 44,936
  • 9
  • 114
  • 120
  • Thanks, but it is not what I want, I want to generate in a particular class, method, or field like in Eclipse. – Raw Aug 29 '17 at 11:51
  • See the `File ...` option, this allows you to set the scope of JavaDoc generation to a **"particular class"**. In addition, the scope modifier (see the slider next to private, package, protected, public) provides some scope to limit the methods covered by the JavaDoc generation. AFAIK that's the limit of JavaDoc generation support in IntelliJ. If you need more you could try raising an issue in [YourTrack](https://youtrack.jetbrains.com/issues/idea/). – glytching Aug 29 '17 at 11:57
  • I want to generate comments on class, method and field, is there a way or template to generate comments quickly start with /** in Eclipse? – Raw Aug 30 '17 at 00:56
  • @JohnChou: I have updated my answer with a description of how to _create_ the JavaDoc content (rather than _generate_ the JavaDoc output). – glytching Aug 30 '17 at 06:57
  • I know the way to generate comments, but I don't know how to configure the template content what starts with /** – Raw Aug 30 '17 at 07:00
  • The IntelliJ JavaDoc template conforms to the [official format of a JavaDoc](http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html#format) so if you want to change that template then perhaps you are not actually creating JavaDocs. Maybe you could update your question to provide an example of your desired format? Although I have just noticed that you have now raised a [separate question](https://stackoverflow.com/questions/45950568/how-to-set-comments-manully-for-class-method-and-field-in-intellij-idea). – glytching Aug 30 '17 at 07:04
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/153211/discussion-between-john-chou-and-glitch). – Raw Aug 30 '17 at 08:44