Skip to content

When viewing JDK sources: "Failed to get sources. Instead, stub sources are generated" #425

Discussion options

You must be logged in to vote

I needed to install the JDK sources:

#   Doesn't install sources.
sudo apt-get install openjdk-17

#   Necessary to see sources on Debian 11, and possibly others
# like Ubuntu and Pop OS.
sudo apt-get install openjdk-17-source

Somewhat embarrassing :). As usual, the software is never broken when you start a Github issue.

Apparently the JDK stores its sources in $JAVA_HOME/lib/src.zip. If that file is missing, or if it is a broken symlink, then that is probably why you don't see JDK sources.

For reference, here is all my configuration after I got (mostly) everything working on Debian 11.

Shell environment (.zshrc, .bashrc or whatever you have).

# Add `jdtls` to the PATH. Change it to wher…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by robert-blankenship
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant