How to attach JDK source code to IntelliJ IDEA?

In this article, we will show you how to attach the JDK source code into the IntelliJ IDEA? By default, IntelliJ IDEA doesn’t come with JDK source code, and the auto decompile feature is useful; however, we still need to jump in the source code to read the source code comments or docs to understand more about the API usage.

1. Where is JDK Source Code?

1.1 Usually, the JDK source code is named, and located at the root folder of the JDK installed path.

For example:


$ /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64$
jdk source code

2. Add the to IntelliJ IDEA

2.1 File -> Project Structure

2.2 Platform Settings -> SDKs -> Select Sourcepath -> plus icon -> select from the JDK installed path.

IntelliJ IDEA attach jdk source

2.3 Done.


About the Author

author image
Founder of, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.