Eric Bergman-Terrell's Blog

How to decompile Java code with JetBrains IntelliJ IDEA (2018.2.3, Windows 10)
October 5, 2018

Sometimes it's necessary to see the Java source code corresponding to a .jar file. Here's how:

In a command shell:

java -cp "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.3\plugins\java-decompiler\lib\java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -hdc=0 -dgs=1 -rsy=1 -rbr=1 -lit=1 -nls=1 -mpm=60 {.class or .jar file to decompile} {folder into which to write results}

For example:

java -cp "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.3\plugins\java-decompiler\lib\java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -hdc=0 -dgs=1 -rsy=1 -rbr=1 -lit=1 -nls=1 -mpm=60 "C:\Program Files\Vault 3\vault_win.jar" c:\temp\decomp

The above command will write a .java source file if the input is a .class file. If the input is a .jar file, it will write a .jar file containing sources. You can easily navigate through the .jar file by adding ".zip" to its file name, and then navigating it with the Windows File Explorer.

One never knows what one will find when decompiling 3rd party .jar files

Keywords: Java, JetBrains, IntelliJ, IDEA

Reader Comments

Comment on this Blog Post

Recent Posts

TitleDate
Node.js + Express: How to Block Requests by User-Agent HeadersJanuary 7, 2026
Vault 3 is Now Available for Windows on ARM Machines!December 13, 2025
Vault 3: How to Include Outline Text in Exported PhotosOctober 26, 2025
.NET Public-Key (Asymmetric) Cryptography DemoJuly 20, 2025
Raspberry Pi 3B+ Photo FrameJune 17, 2025
EBTCalc (Android) Version 1.53 is now availableMay 19, 2024
Vault 3 Security EnhancementsOctober 24, 2023