0

I am having a weird problem with intellij. A handful of people in here, had similar issues in the past but none of the proposed solutions worked for me.

So I am trying to view the javadoc for a builtin class(in my example java.io.FileReader) but I am only getting information about the signature, not details about the method as it is usually happening. I have also tried things around quick and external documentation, I have even added an external doc url in the project settings but nothing happened.

In the screenshot you can see the output I am getting. Any help appreciated.

My output

py_script
  • 808
  • 2
  • 16
  • 38
  • You need to tell IntelliJ where the rt.jar's source jar is. Unfortunately, I can't remember how to do that. I'm pretty sure it's in an obvious place in the options, maybe under the Java/JDK settings. – Paul Hicks Mar 13 '16 at 23:14
  • Press ctrl+alt+shift+s or go to File>Project Structure. Check whether you have jdk correctly installed and configured in the jdk home path in project structure's sdk section. – Milind Gokhale Mar 14 '16 at 02:15
  • @MilindGokhale, I can see a handful of jars in there, indeed, like the rt.jar Paul Hicks mentioned above. Is it something more specific to look at?\ – py_script Mar 14 '16 at 20:47

2 Answers2

1

Looks like Eclipse uses a different approach for the documentation. Also I had a non-fully document API and thats, combined, the reason it was not working.

The solution is as follows: File -> Project structure -> SDKs -> Documentation paths -> Click the add button, with the earth on it -> Add an online documentation source.

If you click the other one, you need to space a folder in your filesystem.

Both work. Thank you for your help.

py_script
  • 808
  • 2
  • 16
  • 38
-1

Ctrl + Q

This assumes you have the JDK (with documentation) downloaded and configured with IntelliJ for the relevant object/class/method.

Edit:
Turned out it was a problem with the Users' JDK.
The JDK source files didn't contain any comments (which IntelliJ uses to show JDK Documentation). This was resolved by installing the JDK Documentation and configuring it with IntelliJ.

Community
  • 1
  • 1
Harmelodic
  • 5,682
  • 1
  • 28
  • 31
  • As you can see in the screenshot, the documentation popup is already shown. the problem is it doesnt contain all the info it should – py_script Mar 14 '16 at 20:48
  • In which case, it will most likely be related to my follow up point. Have you got a JDK installed that contains documentation along with the standard development libraries? Have you configured it correctly? – Harmelodic Mar 14 '16 at 20:56
  • It was working out of the box for Eclipse, but now it is not. I am using the same libraries. How can I check if something is wrong? – py_script Mar 14 '16 at 21:08
  • Weird that it was working for Eclipse, which would indicated that the documentation is present in the JDK. If you view other classes/methods do you see the full documentation? fR.read() is a small method with minimal documentation. Otherwise, my only advise is to download and install the documentation: http://www.oracle.com/technetwork/java/javase/downloads/index.html#docs – Harmelodic Mar 15 '16 at 11:25
  • Unfortunately, I see similar amount of info in all other methods. – py_script Mar 15 '16 at 19:12
  • Do `Ctrl+Q` and then hitting `F4` to open the class the documentation is coming from. The documentation is made from the comment just above the method name. If you don't see documentation in comment, you haven't got a fully documented JDK installed on your machine. If you do, try reinstalling/reconfiguring your JDK with IntelliJ. If both fail, [file a bug report with Jetbrains](https://youtrack.jetbrains.com/issues/IDEA) – Harmelodic Mar 15 '16 at 19:43
  • That a great approach @Harmelodic...I have download jdk8 from oracle's website(I had the one of my distro till now). Indeed the documentation is not present in the decompiled version, but it is not after installing the new jdk as well – py_script Mar 15 '16 at 20:30
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/106393/discussion-between-harmelodic-and-py-script). – Harmelodic Mar 15 '16 at 20:35