I'm currently working on a java project using VSCode and when I hover an object, type or method name, documentation isn't showing anymore. I do not know why or what I did to change that.
In the following picture, I am hovering the first occurence of ByteBuyUtils, and as we can see, nothing is shown.
first hovering example
Here is a picture found on google pictures showing what I want to get when hovering something :
example of what I want when hovering code
I'm using 1.65.1 version of VSCode, on Ubuntu 21.10. I am using openjdk version "18-ea" 2022-03-15.
The following extensions are installed on my VSCode :
You may try a couple of things.
If you are using maven, you need to explicitly download javadoc and source of the packages in your project.
mvn dependency:sourcesmvn dependency:resolve -Dclassifier=javadocIn vscode, you need to set java home property.
Ctrl+Shift+p to open command paletteuser settings jsonsettings.json should be openedjava.jdt.ls.java.home and set the value to the root folder of your openjdk package.For me, it's /usr/lib/jvm/java-17-openjdk-amd64. So I add
"java.jdt.ls.java.home": "/usr/lib/jvm/java-17-openjdk-amd64"
to the settings.json.
To find yours, try
$ which java
/usr/bin/java
$ ls -l /usr/bin/java
...... /usr/bin/java -> /etc/alternatives/java
$ ls -l /etc/alternatives/java
...... /etc/alternatives/java -> /usr/lib/jvm/java-17-openjdk-amd64/bin/java
Trace all the way down with ls -l. The last path before the /bin/java part is your JAVA_HOME.
You can download the doc of your openjdk version via. apt on Ubuntu.
$ sudo apt update
$ apt list | grep openjdk-17-
You should see openjdk-17-doc and openjdk-17-source available. Change 17 to your version of choice (18 for example). Then
$ sudo apt install openjdk-17-doc openjdk-17-source
Restart vscode
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With