29

Can Eclipse show the entire javadoc? i.e. all methods (and their descriptions), when I highlight an object reference?

For example, if I do System, it shows me

java.lang.System

The System class contains several useful class fields and methods. It cannot be instantiated.

Among the facilities provided by the System class are standard input, standard output, and error output streams; access to externally defined properties and environment variables; a means of loading files and libraries; and a utility method for quickly copying a portion of an array.

Since: JDK1.0

but that tells me very little about what I can do with that. Yes, I can use the intelligent dot completion, but that seems a bit cumbersome.

2
  • 1
    If you load source into the classpath you can F3 into the class and read the code. Not the same as Javadoc but partway there... Commented Aug 7, 2012 at 7:10
  • 1
    or I could do "open attached javadoc in browser" (shift-f2), but that negates the value of havingthe javadoc separate from the editing environment (browser seems to open a tab in the editing area)
    – spotter
    Commented Aug 7, 2012 at 7:16

5 Answers 5

45

To see the javadoc of a class having attached source in eclipse:

select Window -> show view -> javadoc (or alt + shift + q, j).

then in the javadoc view, right click -> open attached javadoc (or shift + F2), this will display the javadoc of the class in the internal browser of eclipse.

4
  • shortcut key is Alt + Shift + q, j on my instance Commented Aug 7, 2012 at 8:14
  • 1
    doesn't really help me with how I want. I dont want to have to attach the source for the entire jre....
    – spotter
    Commented Aug 7, 2012 at 14:59
  • Ah, that shortcut in i3 kills the window.
    – stillanoob
    Commented Jul 26, 2018 at 16:24
  • Eclipse 4.31.0 shows javadoc windows, but doesn't show the content. Do you know something about? Commented Mar 28 at 16:46
13

In the source editor hover mouse over some method or class name.

Then press

Shift-F2 (Open External Documentation)

Javadoc View will open the full documentation at the right position.

1
  • Eclipse 4.31.0 Shows javadoc windows, but doesn't show the content. Do you know something about? Commented Mar 28 at 16:47
3

If you have source attached to the classes (Both Java & custom) then you can see it in the Outline view by pressing F3.

1
  • Haaa..i guess shonky linux user added his comment before i pressed submit. Ignore mine if it is duplicate..
    – srivenky
    Commented Aug 7, 2012 at 7:21
3

What you need to do is to hover mouse over some in-built method or class that are using in your program.

Hold ctrl on your keyboard and click. Then eclipse asks you to attach source. click on 'attach source', browse for src.zip file after choosing 'EXTRENAL' file. or instead give path for extracted src folder under same ie external file attachment.

Next time you hover over an in-built class or method it shows a small description. To view entire javadoc for same, keep holding ctrl and click on it.

It worked for me.

2

I know that this post is old. Nevertheless I would like to add a procedure for showing Javadoc in an easy way.

I use eclipse oxygen 4.7.1a which is an year 2017 build.

-> Just hover over any declaration/method/object/class and press F2 to focus and now at the bottom of the tooltip that appears, we can find icons/buttons that can take us to its Javadoc in browser or eclipse view.

shift+F2 directly opens the javadoc of the entity you are hovering over, in a browser in the eclipse.

For this method to work a javadoc needs to be attached to your source. See linking javadoc.

Not the answer you're looking for? Browse other questions tagged or ask your own question.