• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaDoc not showing up

 
Meshulam Silk
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made a jar full of stuff I could use to make a game. I added JavaDoc comments to every single one of the methods. Before I compressed the project into a jar I tested out the comments to see if they show up and they did, but when I compressed it and imported it to a different project, the methods in the jar will work fine and the eclipse suggestions box will recognize them, but their JavaDoc comments don't show up.

Is this normal?
If not what am I missing? What can I do to get those annotations to show (if possible)?

Thanks
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "the annotations show (not) up" mean? Are these compile-time or runtime annotations (meaning, what is their RetentionPolicy)?
 
Meshulam Silk
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:What does "the annotations show (not) up" mean? Are these compile-time or runtime annotations (meaning, what is their RetentionPolicy)?

I'm not quite sure what type of annotations they are as I don't really know how annotations work. All I know is that I put this block in front of a method, then when showing the suggestions box while coding I can see what that method does.

For example:
I put this in the base class

Will show me this when editing in a test class (the yellow box):


However this will only happen if I'm writing in the same project as the method I'm calling. If I import the method as part of an external jar to another project the yellow box will not show up and show me the annotation.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15452
42
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That comment in front of the method is not an annotation. Annotations are something completely different, you were confusing Ulf by calling this an annotation. That comment is a JavaDoc comment. With the JavaDoc tool you can convert this to a set of HTML pages that contain API documentation, in the same way as the API documentation for the standard Java library.

If you're using Eclipse, and you've added a JAR file as a library to your project, then you can attach sources and JavaDoc to the JAR file. Right-click the JAR file in the list of dependencies of the project, click Properties, and in the dialog you can set the source location and JavaDoc location for the JAR file.
 
Meshulam Silk
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper de Jong wrote:That comment in front of the method is not an annotation. Annotations are something completely different, you were confusing Ulf by calling this an annotation. That comment is a JavaDoc comment. With the JavaDoc tool you can convert this to a set of HTML pages that contain API documentation, in the same way as the API documentation for the standard Java library.

If you're using Eclipse, and you've added a JAR file as a library to your project, then you can attach sources and JavaDoc to the JAR file. Right-click the JAR file in the list of dependencies of the project, click Properties, and in the dialog you can set the source location and JavaDoc location for the JAR file.


Oh ok I couldn't find the actual name and annotation seemed close enough. Thanks.
So I figured out how to export the JavaDoc from the pre-jarred project and add it to the imported jar in the new project like you said and now it works!
But, is there a way for the JavaDoc to be automatically attached to the jar (so I won't have to do this every time I import the jar)?

Either way, thanks for the help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic