Home » Java » How to see JavaDoc in IntelliJ IDEA?

How to see JavaDoc in IntelliJ IDEA?

Posted by: admin November 2, 2017 Leave a comment

Questions:

I just switched from Eclipse to IntelliJ and lack one feature from Eclipse – when you put your mouse over a method it shows a javadoc info. I found out (may be I’m wrong) the way to show is a shortcut command + J. When I click it I get something wrong, please see on the screen shot below. Please advice how can I quickly get javadoc information. I need at least know what type a method returns.

enter image description here

Answers:

Use View | Quick Documentation or the corresponding keyboard shortcut (by default: Ctrl+Q on Windows/Linux and Ctrl+J on Mac). See the documentation for more information.

It’s also possible to enable automatic JavaDoc popup on explicit (invoked by a shortcut) code completion in Preferences | Editor | General | Code completion (Autopopup documentation):

autopopup documentation

Yet another way to see the quick doc is on mouse move:

on mouse move

Questions:
Answers:

In version 13.1+, there is a setting for that

Go to File/Settings, IDE Settings / Editor, then ✔ Show quick doc on mouse move.

Version 14.0+:

Go to File/Settings, Editor, click on General. Scroll down, then ✔ Show quick documentation on mouse move.

enter image description here

Questions:
Answers:

Alternatively you can position your cursor on the item and show JavaDoc using

CTRL+Q

which is the default shortcut.

Edit: As Methical mentioned on Mac the shortcut is

CTRL+j (^+j not +j)

Questions:
Answers:

There is nice feature which shows quick documentation when your mouse is over element.

IntelliJ 14

Editor / General -> Show quick documentation on mouse move

Older versions

Add the following line to idea.properties file:

auto.show.quick.doc=true

Questions:
Answers:

To best mirror Eclipses functionality, enable the following settings:

  • IDE Settings/Editor -> Other.Show quick doc on mouse move
  • IDE Settings/Editor/Code Completion -> Autopopup Documentation

To see the javadoc in the autocomplete menu, hit ‘.’ to get the popup, then hover over the object you are working with, once you get the javadoc popup, you can select an item in the popup to switch the javadoc over. Not ideal… But its something.

As another note. The search functionality of the options menu is very useful. Just type in ‘doc’ and you will see all the options for doc.

Also, searching for “autopopup doc” will not only find each of the options, but it will also highlight them in the menu. Pretty awesome!


Edit:
Going beyond the initial question, this might be useful for people who just want quick and easy access to the docs.

After using this for a few more days, it seems just getting used to using the hotkey is the most efficient way. It will pop up the documentation for anything at the spot of where your text input marker is so you never have to touch the mouse. This works in the intellisense popup as well and will stay up while navigating up and down.

Personally, Ctrl+Q on windows was not ideal so I remapped it to Alt+D. Remaping can be done under IDE Settings/Keymap. Once in the keymap menu, just search for Quick Documentation.

Questions:
Answers:

Go to Settings -> Editor -> General then enable Show quick documentation on mouse move

Questions:
Answers:

The closest to Eclipse will be Ctrl+Button2 Click (Scroll click)

It’s called Quick Doc in IntelliJ, I wish guys from JetBrains one day add quick doc like Eclipse with Ctrl+Mouse Move it’s so much better.

In my case only with only mouse move is a bit annoying, so if you search in Preferences/Settings –> Keymap for “quick documentation” you will find:

  • Win-Linux: “Ctrl+Q” and “Ctrl+Button2 Click” (Scroll click)
  • Mac: “Ctrl+J” and “Ctrl+Button2 Click” (Scroll click)
Questions:
Answers:

IntelliJ IDEA 15 added this feature

Now it is available as EAP.

As you can see in the picture below, the caret position doesn’t influence the cursor position:
enter image description here

This feature was implemented in IntelliJ IDEA 15 142.4675.3 Release Notes.

Questions:
Answers:

For me, it wasn’t just getting the javadoc window to open, but also getting the complete javadoc to present. You may still get a sparse javadoc that is based solely on the method signature if you are importing libraries from a Maven repository and do not tell Idea to include the javadocs in the download. Be sure to tick the “JavaDocs” option in the “Download Library From Maven Repository” dialog, which can be found under Project Structure -> Projtect Settings -> Libraries.

Questions:
Answers:

I have noticed that selecting the method name and pressing F2(Quick Documentation) dispalys it’s JavaDoc.
I am using Intellij 2016, and Eclipse Keymap

Questions:
Answers:

Configuration for IntelliJ IDEA CE 2016.3.4 to enable JavaDocs on mouse hover. I am running IntelliJ IDEA on Mac OS but believe that Linux/Windows should have similar options.

Autopopup docs:
IntelliJ IDEA > Preferences > Editor > General > Code Completion

enter image description here

Documentation on mouse move:
IntelliJ IDEA > Preferences > Editor > General

enter image description here

NOTE: Please hit Apply button to apply these settings