View JAR Source in IntelliJ IDEA | Generated by AI

Home 2025.09

In IntelliJ IDEA, you can easily view the source code of a JAR file. There are a few approaches depending on whether the JAR contains source files or just compiled .class files:


1. Open the JAR in IDEA


2. Attach Sources to a Library JAR

If the JAR is part of a library (like Maven or Gradle dependencies):


3. Quick Navigation


4. External Decompiler Plugins (Optional)

IDEA already has a built-in decompiler, but you can install plugins like Fernflower or CFR if you want alternative decompilation.


👉 Usually, if it’s a dependency managed by Maven/Gradle, IDEA can automatically download and attach the -sources.jar from the repository. If it’s a standalone JAR, you’ll need to attach sources manually or rely on the decompiler.

Do you want me to also explain how to extract the JAR’s source code outside IDEA (using tools like jd-gui or jar xf), or do you mainly want to stick to working inside IDEA?


Back Donate