Reputation: 4977
The shortcut for this action is Shift+F1 but it is always grayed out even though I have pointed JDK documentation path
to the docs
folder (the docs folder is unzipped from jdk-7u2-apidocs.zip ).
Thanks
Upvotes: 67
Views: 35257
Reputation: 2584
Adding online URL as documentation introduces a delay for the documentation to pop up. I prefer linking my sources from local for zero lag.
You should be able to find the src.zip
in jdk/lib/src.zip
path. Add that archive in your documentation paths and you're all set.
If using some other JDK, you could grab the sources separately. Or might come bundled.
Upvotes: 0
Reputation: 1045
Other answers are satisfying but in case you still can't see the documentation, make sure that your java file is located under the src
path.
Upvotes: 0
Reputation: 16730
You can add the external Javadocs API link as shown below:
File
> Project Structure...
SDKs
(under Platform Settings
)Documentation Paths
tabSpecify URL
button and add the link for JDK 11 API docs (https://docs.oracle.com/en/java/javase/11/docs/api/)Upvotes: 7
Reputation: 425
Posting this here in case you're like me and don't necessarily want javadocs, but rather the documentation inside your IDE.
In my situation, I had downloaded OpenJDK 11 and wasn't able to get documentation inside IntelliJ. Instead I was getting decompiled code.
What helped me was the answer at https://stackoverflow.com/a/38413439 i.e.
/usr/lib/jvm/openjdk-11/
).src.zip
(for me, /usr/lib/jvm/openjdk-11/lib/src.zip
).Let Intellij index and it should be available in your IDE.
Upvotes: 4
Reputation: 101
Java 10 Documentation path
Got to File -> Project Structure Choose External URL
Below Link works Fine... THe default one does'nt work
https://docs.oracle.com/javase/10/docs/api/
Upvotes: 1
Reputation: 401897
You need to specify the docs/api
subdirectory of the unpacked documentation or use https://docs.oracle.com/javase/8/docs/api/
URL for the external documentation feature to work.
File -> Project Structure...
then here :
Upvotes: 110
Reputation: 737
For IntelliJ Idea: Call "Project Structure" (Ctrl+Shift+Alt+S), go to "Platform Setting - SDKs", choose "Documentation Path" tab on the right, then add url of JavaDoc (http://docs.oracle.com/javase/7/docs/api/) to your project
Upvotes: 5
Reputation: 2665
I understand the question as follows:
You would like to see javadocs of classes that are not within JDK. I am a bit uncertain because CrazyCoder's reply is talking about JDK specific javadocs.
I am using Macos 10.8.4 and Intellij 11.1.5
The project I am working on is a mvn based project with many modules which have complex dependencies.
Let me take a concrete example to explain what I did, I am sure it can be reproduced for others: apache sshd
I downloaded the javadoc from maven central stored it stored it somewhere. In intellij I went to the module settings (shortcut F4) and the to Libraries in the sidebar. Maven pulls all dependencies automagically and I can find sshd there. The right side then shows Classes, Sources and JavaDocs. The JavaDocs part in my case had a path linked in that pointed to my local m2 directory. However the directory did not contain the javadoc jar file. So I thought how do I get it:
mvn dependency:resolve -Dclassifier=javadoc
However this failed for because we do not have some javadocs in our nexus (I guess, not sure).
So I ended up linking the file that I downloaded manually in as a javadoc link and this then allown me to use Shift+F1 for the javadoc to open in my standard browser.
Maybe others can elaborate on how to get this done with mvn. I did not have the time to further investigate.
Upvotes: 2
Reputation: 1108
I'm using 10.5.4. It was unclear to me from the docs or from resources online that you need to add this at Project Structure > SDK's > (Choose your SDK) > Documentation Paths > Specify URL.
Upvotes: 16