I wasn't sure to post here or in the StackOverflow community but here goes...

I have Ubuntu 18.04.3 LTS installed on my laptop. I'm trying to set up IntelliJ at the moment. I installed my jdk by running apt-get install default-jdk which installed java in my /usr/bin/java directory. However, when coding, I am unable to see the source library code in IntelliJ. I only see the decompiled .class files, which isn't really easy to read, and doesn't contain any comments.

Basically, my question boils down to: How do I download the openjdk 11.0.3 source code and make intelliJ use that?


First install openjdk-11-source. Then in IntelliJ go to Project Structure -> SDKs, select your jdk and go to sourcepath tab. There you add the file /usr/lib/jvm/openjdk-11/lib/src.zip as source.

  • Hi @noeppi noeppi, I tried what you said and it worked. A few clarifications: I went into Project Structure -> SDKs, not JDKs. I also selected the already-installed version of openjdk that I got by running apt-get install default-jdk, as this is the package that has the actual binaries/class files. Then I clicked on the sourcepath tab as you said – Random_User Sep 22 '19 at 6:29
  • @Random_User I fixed my answer – noeppi noeppi Sep 22 '19 at 6:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.