Site icon Automation Dojos

How to View Java API Doc Hints within IntelliJ

IntelliJ Quick Documentation

So how do you generally refer your Java API Doc? If you use Google or online Java API Doc or even a locally downloaded copy then here is a better way, why not view the JavaDoc hints within IntelliJ editor itself. The article below shows the quick and easy procedure to do this, interested? keep reading.

Provided you are using Java SDK, In IntelliJ IDEA, you can view Java API Doc (SDK) for any symbol or method signature right from the editor via IntelliJ feature also called ‘Quick Documentation’ which you can invoke via keyboard shortcut Ctrl+Q

This feature should be enabled by default, if not here is how to enable it.

Enabling IntelliJ ‘Quick Documentation’

Open IntelliJ Settings

Launch the IntelliJ settings by navigating to [File | Settings]

Enable ‘Show documentation popup’

On the settings dialog box, navigate to [Editor | Code Completion] and enable the option ‘Show the documentation popup in 1000ms’ (Of course you can input whatever time value you wish) and click ‘Apply’

Enable ‘Documentation on mouse move’

While on settings dialog box again navigate to [Editor | General] and enable the option ‘Show quick documentation on mouse move’. Click ‘Apply’ and ‘OK’.

Validate your changes

Check by invoking the ‘Quick Documentation’ for any piece of code by pressing Ctrl+Q while in the editor

Enhance by adding documentation URL

You can add online java SDK documentation to your IntelliJ ‘project settings’ so that you can get more enhanced information about classes, symbols and method signatures etc.

Locate Javadoc online documentation

Locate the URL for your JavaDoc online. For example, the URL for Java 11 Java API Doc is – https://docs.oracle.com/en/java/javase/11/docs/api/index.html

Open ‘project settings’ dialog box

On IntelliJ, launch the project settings [File | Project Structure]

Open SDK documentation tab

On ‘project structure’ dialog box, click on ‘SDKs’ on right hand side column and then click on ‘Documentation Paths’ tab in right hand side pane

Add documentation path/url

Now add the documentation url. Click ‘Ok’ and save. That’s it!

Validate your changes

Check by invoking the ‘Quick Documentation’ for any piece of code by pressing Ctrl+Q while in the editor.

[td_smart_list_end]
Exit mobile version