OpenJDK 11 javadoc not returned on hover
See original GitHub issueI am running Debian testing with OpenJDK 11. I am using Neovim v0.3.4. Lately, jdt.ls has not been returning javadoc from the OpenJDK 11 doc package in hover responses. For example, if I hover on the keyword String
, I do not get the javadoc for String
. Instead I get this:
I had it working with snapshot
jdt-language-server-0.36.0-201903201910
and neoclide/coc-java as my client for a while and it just suddenly stopped working. The problem seemed to be that I had set JAVA_HOME for maven and I was able to get snapshot jdt-language-server-0.36.1-201904020132
to send javadoc by explicitly configuring the path to the jdk in coc’s settings (even though it was the same path as JAVA_HOME). However, jdt.ls has stopped sending the jdk javadoc again and I have not been able to get it to work again. I have tried the most recent snapshot (jdt-language-server-0.37.0-201904162228
) but it does not send the jdk javadoc either. To rule out coc as the problem, I also tried using prabirshrestha/vim-lsp as my client and I still had the same problem. Here is a trace I get from coc:
[Trace - 3:45:08 PM] Sending request 'textDocument/hover - (5)'.
Params: {
"textDocument": {
"uri": "file:///home/user/udemy/maven/mb2g-lombok/src/main/java/guru/springframework/model/User.java"
},
"position": {
"line": 12,
"character": 14
}
}
[Trace - 3:45:08 PM] Received response 'textDocument/hover - (5)' in 56ms.
Result: {
"contents": {
"language": "java",
"value": "java.lang.String"
}
}
The bug report I made to neoclide/coc-java concerning this issue can be found here. I have closed that issue since this seems to be a problem between jdt.ls and OpenJDK 11 on Debian and not an issue with my lsp client.
Issue Analytics
- State:
- Created 4 years ago
- Comments:26 (12 by maintainers)
Same issue in ubuntu. Fixes with
sudo ln -fsr /usr/lib/jvm/openjdk-11/lib/src.zip /usr/lib/jvm/java-11-openjdk-amd64/src.zip
. Need to install openjdk-11-source as welldon’t fully understand why it works, but this command helped me resolve same issue in IntelliJ IDEA 2019.3.1 (Ultimate Edition) on ubuntu 18.04.3 LTS - i had no documentation for Java SE 11 when pressing Ctrl-Q
Thanks a lot!