How to set javadoc of external libraries in IntelliJ Idea?

Viewed 2721

In IntelliJ Idea I set offline javadoc of Java SDK in Project structure -> SDKs -> Documentation Paths and add path to documentation folder. Whenever I want to see tooltip I just press Ctrl + Q to see offline documentation for a symbol at caret. But it works only for Java SDK. For example - I am using servlet-api.jar library, I downloaded servlet-api javadoc, but I cannot import it to IntelliJ Idea in any way. I tried to add it to SDKs -> Documentation Paths but it didn't work. Is it a way how to import offline javadoc of other libraries to see tooltips easily?

This attempt doesn't work. enter image description here

3 Answers

When the project type is not Maven or Gradle, adding Javadoc for particular library is done via settings in Project Structure(Ctrl + Shift + Alt + S). Add library by choosing Java from option. Then add particular JavaDoc for that library. Then choose apply. To see tooltip window not only by pressing Ctrl + Q but also by hover over symbol, choose File -> Settings -> Editor -> General -> and check Show quick documentation on mouse move.

adding library

adding javadoc

before applying

You can load your api in the libraries of your project along with the javadocs.

Open your Project structure (Ctrl+Alt+Shift+S). Add your library (like Servlet-api from maven)

enter image description here

make sure to check the JavaDocs box

enter image description here

Now you can use Ctrl+Q with this library.

EDIT: Here is an example for info() method of the log4j library documentation Ctrl+Q:

![enter image description here

the popup window might be resized to show content. Just drag the right bottom.
Or use the tool window for documentation with View > Tool Window > Documentation.

Let me know if it helps.

Related