Inspecting Java 8 standard lib files shows Decompiled .class file instead of JavaDoc version on Ubuntu 16.04 Open JDK 8

Answered

Here's my current setup:

Thu Feb 15 01:25 PM ~: sudo apt-get install openjdk-8-jdk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
openjdk-8-jdk is already the newest version (8u151-b12-0ubuntu0.16.04.2).
0 upgraded, 0 newly installed, 0 to remove and 43 not upgraded.

Thu Feb 15 01:26 PM ~: sudo apt-get install openjdk-8-doc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
openjdk-8-doc is already the newest version (8u151-b12-0ubuntu0.16.04.2).
0 upgraded, 0 newly installed, 0 to remove and 43 not upgraded.


Thu Feb 15 01:20 PM jvm: la
total 4.0K
lrwxrwxrwx 1 root root   20 Jul 27  2017 java-1.8.0-openjdk-amd64 -> java-8-openjdk-amd64
drwxr-xr-x 7 root root 4.0K Nov  8 08:31 java-8-openjdk-amd64
/usr/lib/jvm

Thu Feb 15 01:21 PM jvm: which java
/usr/bin/java

Thu Feb 15 01:21 PM jvm: echo $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64

Thu Feb 15 01:22 PM jvm: cs java-8-openjdk-amd64/
total 20K
lrwxrwxrwx 1 root root   22 Oct 27 15:51 ASSEMBLY_EXCEPTION -> jre/ASSEMBLY_EXCEPTION
drwxr-xr-x 2 root root 4.0K Nov  8 08:31 bin
lrwxrwxrwx 1 root root   41 Jul 27  2017 docs -> ../../../share/doc/openjdk-8-jre-headless
drwxr-xr-x 3 root root 4.0K Nov  8 08:31 include
drwxr-xr-x 5 root root 4.0K Nov  8 08:31 jre
drwxr-xr-x 3 root root 4.0K Nov  8 08:31 lib
drwxr-xr-x 4 root root 4.0K Aug 29 08:12 man
lrwxrwxrwx 1 root root   20 Oct 27 15:51 src.zip -> ../openjdk-8/src.zip
lrwxrwxrwx 1 root root   22 Oct 27 15:51 THIRD_PARTY_README -> jre/THIRD_PARTY_README
/usr/lib/jvm/java-8-openjdk-amd64


Java works and compiles perfectly fine and was easy to configure with IntelliJ but for the life of me I can't get the JavaDocs to show up whenever I mouse over anything - even my own comments. And when I drill down into Java classes like ArrayList I get the decompiled byte code versions.

I know to configure the JavaDoc settings in File -> Project Structure -> Documentation Paths but I don't know what value to put there to get the JavaDocs for the standard lib to show up.

5 comments
Comment actions Permalink

Local api folder of the unpacked JavaDoc or https://docs.oracle.com/javase/8/docs/api/ URL will work:

Properly attaching sources to the JDK will fix the decompiled code issue:

1
Comment actions Permalink

Hi Serge,

Thanks for the quick response. My 'src.zip' file is actually a broken symbolic link and I fear that may be the big issue here. I see that you're on Windows. Do you have any Linux experience? I'll have to try to debug why my 'src.zip' file is missing.

Thu Feb 15 01:42 PM java-8-openjdk-amd64: la
total 20K
lrwxrwxrwx 1 root root   22 Oct 27 15:51 ASSEMBLY_EXCEPTION -> jre/ASSEMBLY_EXCEPTION
drwxr-xr-x 2 root root 4.0K Nov  8 08:31 bin
lrwxrwxrwx 1 root root   41 Jul 27  2017 docs -> ../../../share/doc/openjdk-8-jre-headless
drwxr-xr-x 3 root root 4.0K Nov  8 08:31 include
drwxr-xr-x 5 root root 4.0K Nov  8 08:31 jre
drwxr-xr-x 3 root root 4.0K Nov  8 08:31 lib
drwxr-xr-x 4 root root 4.0K Aug 29 08:12 man
lrwxrwxrwx 1 root root   20 Oct 27 15:51 src.zip -> ../openjdk-8/src.zip
lrwxrwxrwx 1 root root   22 Oct 27 15:51 THIRD_PARTY_README -> jre/THIRD_PARTY_README

Thu Feb 15 01:43 PM java-8-openjdk-amd64: ls -la src.zip
lrwxrwxrwx 1 root root 20 Oct 27 15:51 src.zip -> ../openjdk-8/src.zip
Thu Feb 15 01:43 PM java-8-openjdk-amd64: ls -la ../openjdk-8/src.zip
ls: cannot access '../openjdk-8/src.zip': No such file or directory

0
Comment actions Permalink

Hi Serge,

It looks like

#1 sudo apt-get install openjdk-8-doc

and

#2 sudo apt-get install openjdk-8-source

do different things on Ubuntu and install different docs / java sources.

After running #2 my symbolic link from src.zip -> ../openjdk-8/src.zip became valid and source and javadoc comments are working great now.

Do you know off chance why they aren't showing up on mouseover? I assigned a hotkey to Quick Documentation which is working great but I'd like mouse-over functionality.

0
Comment actions Permalink

You need to enable this option:

1
Comment actions Permalink

That fixed it. You're the man. We solved both my nagging IntelliJ issues. Thanks a million!

0

Please sign in to leave a comment.