0

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?

1 Answer 1

0

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.

2
  • 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 Sep 22, 2019 at 6:29
  • @Random_User I fixed my answer
    – user958619
    Sep 22, 2019 at 6:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .