How to see JavaDoc in IntelliJ IDEA?

JavaIntellij IdeaIdeJavadoc

Java Problem Overview


I just switched from Eclipse to IntelliJ. IntelliJ lacks one feature from Eclipse - when you put your mouse over a method, Eclipse shows javadoc info. I think the way to show it is to use a shortcut - command+J, but when I click it, I get something wrong as on the screen shot below. Please advise me on how I can quickly get javadoc information. I need to at least know what type a method returns.

enter image description here

Java Solutions


Solution 1 - Java

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

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

autopopup documentation

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

on mouse move

Solution 2 - Java

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)

Solution 3 - Java

Go to File/Settings, Editor, click on General.

Scroll down, then ✔ Show quick documentation on mouse move.

enter image description here

Solution 4 - Java

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

Solution 5 - Java

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

Solution 6 - Java

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.

Solution 7 - Java

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.

Solution 8 - Java

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

Solution 9 - Java

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.

Solution 10 - Java

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)

Solution 11 - Java

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEugeneView Question on Stackoverflow
Solution 1 - JavaCrazyCoderView Answer on Stackoverflow
Solution 2 - JavaDropoutView Answer on Stackoverflow
Solution 3 - JavaMartin WickmanView Answer on Stackoverflow
Solution 4 - JavaMichal Z m u d aView Answer on Stackoverflow
Solution 5 - JavarealPKView Answer on Stackoverflow
Solution 6 - JavaJ.D.View Answer on Stackoverflow
Solution 7 - JavaCraig LoweryView Answer on Stackoverflow
Solution 8 - JavaVorkView Answer on Stackoverflow
Solution 9 - JavaROMANIA_engineerView Answer on Stackoverflow
Solution 10 - Javar1ckrView Answer on Stackoverflow
Solution 11 - JavarazvangView Answer on Stackoverflow