Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse: add javadoc

How can I generally add javadoc in eclipse for different packages.

As an example:
I want to add all the javadoc for hibernate in eclipse, but I don't know how. I've read this article How to add hibernate javadocs in Eclipse? but I don't want to get hibernate tools because I already use STS and I don't understand the other comment.

I'm using eclipse on Ubuntu.

like image 651
Marius Avatar asked Aug 12 '11 16:08

Marius


People also ask

How do I write Javadoc comments in Eclipse?

Bear the following in mind when using Add Javadoc comment (Alt+Shift+J): To add a comment to a field, position the cursor on the field declaration. To add a comment to a method, position the cursor anywhere in the method or on its declaration.

Where do I put Javadoc in Eclipse?

Step 1 − Open eclipse, select the option Project →Generate Javadoc. Step 2 − Select the javadoc.exe file from the bin folder of java installation directory, select the destination folder for the generated java doc and select Next. finish button.

How do you add a Javadoc?

Add a Javadoc using context actionsPlace the caret at the declaration in the editor, press Alt+Enter , and select Add Javadoc from the list.


3 Answers

I am using Eclipse Helios x64 in Windows 7 x64.

In your project properties:

Project Properties

like image 64
Marcelo Avatar answered Oct 22 '22 13:10

Marcelo


Another option is to use maven/m2eclipse to manage your dependencies.

It's way overkill if you have the problem for 1 or 2 libraries, but worth considering if you have a dozen.

Most open source projects publish both the jar and the -src.jar artifacts, and m2eclipse can go and download automatically the source for you.

like image 40
ptyx Avatar answered Oct 22 '22 13:10

ptyx


Run

mvn eclipse:eclipse -DdownloadJavadocs=true -DdownloadSources=true

and refresh your eclipse module. Voila! No need for any eclipse plugins (unless you are already using them).

like image 25
Matthew Cachia Avatar answered Oct 22 '22 15:10

Matthew Cachia