Explain Codes LogoExplain Codes Logo

How to see JavaDoc in IntelliJ IDEA?

java
intellij-idea
javadoc
ide-settings
Nikita BarsukovbyNikita Barsukov·Jan 2, 2025
TLDR

To quickly activate JavaDoc in IntelliJ IDEA, position the cursor over any code element and press Ctrl+Q (or F1 on macOS). This action produces a brief overlay of the JavaDoc. For a persistent view window, press Ctrl+Q twice. For JavaDoc capabilities for standard classes, attach the JDK source via Project Structure > SDKs, and link the src.zip from your JDK home directory.

Use Preferences > Editor > General > Code Completion to auto-activate JavaDoc popup on code completion, check the box that says Autopopup documentation. You can use manual quick documentation to avoid constant pop-ups.

Quick access to JavaDoc

Getting instant access to documentation empowers you to code with greater understanding. There are several ways to access JavaDocs in IntelliJ IDEA.

Keyboard Command: Quick Documentation

Press Ctrl+Q (Cmd+Q for macOS) to display an immediate overview of the documentation.

// Code is like a joke, if you have to explain it, it's bad. // So let's make our code self-explanatory with JavaDocs. // Try this funny key. String whiteRabbit = "I'm late!";

Auto JavaDoc Popups: Be spoiled

Want the IDE to spoon-feed you JavaDocs as you type? Enable automatic JavaDoc popups:

Preferences > Editor > General > Code Completion > Tick Autopopup documentation box.

// You know, it's cool being a programmer. // It's kind of like being a wizard // But... in IntelliJ IDEA, with auto JavaDoc, it's more like being Dumbledore. int magicSpell = 42;

On Mouse Move: Stealthy Lookup

Hover the mouse pointer over a code element to sneak a peek at the JavaDoc:

Preferences > Editor > General > Tick Show quick documentation on mouse move box.

// Why did the developer hover his mouse? // To summon the magic tooltip of wisdom! boolean thisIsEpic = true;