2023: splashout suggests in the comments the Vineflower/vineflower decompiler (releases), renaming from Quiltflower to Vineflower.

java -jar vineflower.jar -dgs=1 c:\Temp\binary\library.jar c:\Temp\souce

2022 update: QuiltMC/quiltflower is the latest most advanced Java decompiler:

Quiltflower is a modern, general purpose decompiler focused on improving code quality, speed, and usability.
Quiltflower is a fork of Fernflower and Forgeflower.

Changes include:

  • New language features (Try with resources, switch expressions, pattern matching, and more)
  • Better control flow generation (loops, try-catch, and switch, etc.)
  • More configurability
  • Better error messages
  • Javadoc application
  • Multithreading
  • Optimization
  • Many other miscellaneous features and fixes

Originally intended just for use with the QuiltMC toolchain with Minecraft, Quiltflower quickly expanded to be a general purpose java decompiler aiming to create code that is as accurate and clean as possible.

If the name sounds familiar it's because Quiltflower is a fork of Fernflower, the (in)famous decompiler that was developed by Stiver, maintained by Jetbrains, and became the default decompiler in Intellij IDEA.
Fernflower also quickly found its way into many other tools.

Over the past year, Quiltflower has added support for features such as modern string concatenation, a code formatter, sealed classes, pattern matching, switch expressions, try-with-resources, and more. Quiltflower also focuses on the code quality of the decompiled output, and takes readability very seriously.

See output examples.

Runs nice with jbang

https://github.com/QuiltMC/quiltflower/releases/download/1.8.1/quiltflower-1.8.1.jar

Or:

java -jar quiltflower.jar -dgs=1 c:\Temp\binary\library.jar c:\Temp\binary\Boot.class c:\Temp\source\

2009: JavaDecompiler can do a good job with a jar: since 0.2.5, All files, in JAR files, are displayed.

See also the question "How do I “decompile” Java class files?".

The JD-Eclipse doesn't seem to have changed since late 2009 though (see Changes).
So its integration with latest Eclipse (3.8, 4.2+) might be problematic.

JD-Core is actively maintained.

Both are the result of the fantastic work of (SO user) Emmanuel Dupuy.


2018: A more modern option, mentioned in the comments by David Kennedy Araujo:

JetBrains/intellij-community/plugins/java-decompiler/engine

Fernflower is the first actually working analytical decompiler for Java and probably for a high-level programming language in general.

java -jar fernflower.jar [-<option>=<value>]* [<source>]+ <destination>

java -jar fernflower.jar -hes=0 -hdc=0 c:\Temp\binary\ -e=c:\Java\rt.jar c:\Temp\source\

See also How to decompile to java files intellij idea for a command working with recent IntelliJ IDEA.


2022 update: Florian Wendelborn suggests in the comments

this one works well: jdec.app from Leonardo Santos.

Answer from VonC on Stack Overflow
🌐
Java Decompiler
java-decompiler.github.io
Java Decompiler
JD-GUI supports CLASS, JAR, WAR, EAR, AAR, KAR, JMOD & ZIP files. JD-GUI displays color coded Java source code. JD-GUI allows you to browse the CLASS files and Java modules hierarchy. JD-GUI lets you drag and drop LOG files, decompile CLASS files, and display the line of code that appears in ...
🌐
Java Decompilers
javadecompilers.com
Java decompiler online
Java decompilers online: *JAD, *JDCore, *Procyon, *Fernflower, *CFR. ✓ A user interface to extract source code from .class and .jar ‘binary’ files.
Top answer
1 of 8
401

2023: splashout suggests in the comments the Vineflower/vineflower decompiler (releases), renaming from Quiltflower to Vineflower.

java -jar vineflower.jar -dgs=1 c:\Temp\binary\library.jar c:\Temp\souce

2022 update: QuiltMC/quiltflower is the latest most advanced Java decompiler:

Quiltflower is a modern, general purpose decompiler focused on improving code quality, speed, and usability.
Quiltflower is a fork of Fernflower and Forgeflower.

Changes include:

  • New language features (Try with resources, switch expressions, pattern matching, and more)
  • Better control flow generation (loops, try-catch, and switch, etc.)
  • More configurability
  • Better error messages
  • Javadoc application
  • Multithreading
  • Optimization
  • Many other miscellaneous features and fixes

Originally intended just for use with the QuiltMC toolchain with Minecraft, Quiltflower quickly expanded to be a general purpose java decompiler aiming to create code that is as accurate and clean as possible.

If the name sounds familiar it's because Quiltflower is a fork of Fernflower, the (in)famous decompiler that was developed by Stiver, maintained by Jetbrains, and became the default decompiler in Intellij IDEA.
Fernflower also quickly found its way into many other tools.

Over the past year, Quiltflower has added support for features such as modern string concatenation, a code formatter, sealed classes, pattern matching, switch expressions, try-with-resources, and more. Quiltflower also focuses on the code quality of the decompiled output, and takes readability very seriously.

See output examples.

Runs nice with jbang

https://github.com/QuiltMC/quiltflower/releases/download/1.8.1/quiltflower-1.8.1.jar

Or:

java -jar quiltflower.jar -dgs=1 c:\Temp\binary\library.jar c:\Temp\binary\Boot.class c:\Temp\source\

2009: JavaDecompiler can do a good job with a jar: since 0.2.5, All files, in JAR files, are displayed.

See also the question "How do I “decompile” Java class files?".

The JD-Eclipse doesn't seem to have changed since late 2009 though (see Changes).
So its integration with latest Eclipse (3.8, 4.2+) might be problematic.

JD-Core is actively maintained.

Both are the result of the fantastic work of (SO user) Emmanuel Dupuy.


2018: A more modern option, mentioned in the comments by David Kennedy Araujo:

JetBrains/intellij-community/plugins/java-decompiler/engine

Fernflower is the first actually working analytical decompiler for Java and probably for a high-level programming language in general.

java -jar fernflower.jar [-<option>=<value>]* [<source>]+ <destination>

java -jar fernflower.jar -hes=0 -hdc=0 c:\Temp\binary\ -e=c:\Java\rt.jar c:\Temp\source\

See also How to decompile to java files intellij idea for a command working with recent IntelliJ IDEA.


2022 update: Florian Wendelborn suggests in the comments

this one works well: jdec.app from Leonardo Santos.

2 of 8
43

First of all, it's worth remembering that all Java archive files (.jar/.war/etc...) are all basically just fancy.zip files, with a few added manifests and metadata.

Second, to tackle this problem I personally use several tools which handle this problem on all levels:

  • Jad + Jadclipse while working in IDE for decompiling .class files
  • WinRAR, my favorite compression tool natively supports Java archives (again, see first paragraph).
  • Beyond Compare, my favorite diff tool, when configured correctly can do on-the-fly comparisons between any archive file, including jars. Well worth a try.

The advantage of all the aforementioned, is that I do not need to hold any other external tool which clutters my work environment. Everything I will ever need from one of those files can be handled inside my IDE or diffed with other files natively.

🌐
Jdec
jdec.app
JDec - Java Decompiler Online
JDec is a online Java decompiler that provides a fast way to decompile JAR files. Instant access to the files, no need to wait. Also supports downloading decompiled java code.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 6061217524626-How-to-decompile-and-debug-a-jar-file
How to decompile and debug a .jar file? – IDEs Support (IntelliJ Platform) | JetBrains
Go to the Project tool window shown on the left. Search for jar name that you added in the previous step. Navigate to the desired class or package. You will be able to see the decompiled java files for that jar.
🌐
Reddit
reddit.com › r/java › looking for a java decompiler
r/java on Reddit: Looking for a Java decompiler
June 13, 2017 -

I have a couple of .jar games on my disk. I want to decompile the bytecode back to the readable .java format.

What are my options? Google wasn't very helpful, throwing old sites at me with broken download links.

I just want to learn - I played the game lots of times so I know what it does, now I want to know how it does it.

EDIT: Thanks to everyone who replied, the post stays so that others can use. I decided to use jd-gui, but it's good to know many Java IDEs have plugins to do this too (I use Netbeans and I couldn't find a decompiler plugin for it)

🌐
GitHub
github.com › java-decompiler › jd-gui
GitHub - java-decompiler/jd-gui: A standalone Java Decompiler GUI
> git clone https://github.com/java-decompiler/jd-gui.git > cd jd-gui > ./gradlew build · generate : "build/libs/jd-gui-x.y.z.jar" "build/libs/jd-gui-x.y.z-min.jar" "build/distributions/jd-gui-windows-x.y.z.zip" "build/distributions/jd-gui-osx-x.y.z.tar" "build/distributions/jd-gui-x.y.z.deb" "build/distributions/jd-gui-x.y.z.rpm" Double-click on "jd-gui-x.y.z.jar" Double-click on "jd-gui.exe" application from Windows ·
Starred by 14.9K users
Forked by 2.5K users
Languages   Java 96.3% | ANTLR 2.3% | Shell 1.4%
Find elsewhere
🌐
eikendev
eiken.dev › blog › 2021 › 02 › how-to-break-your-jar-in-2021-decompilation-guide-for-jars-and-apks
How to Break Your JAR in 2021 - Decompilation Guide for JARs and APKs | eikendev
February 26, 2021 - CFR will decompile modern Java features - up to and including much of Java 9, 12 & 14, but is written entirely in Java 6, so will work anywhere! Releases can be found on GitHub and other places, although I’m not sure if it is entirely open-source. Being a Java project, it compiles conveniently into a single JAR file.
🌐
Benf
benf.org › other › cfr
CFR - yet another java decompiler.
(FAQ) - It'll even make a decent go of turning class files from other JVM languages back into java! To use, simply run the specific version jar, with the class name(s) you want to decompile (either as a path to a class file, or as a fully qualified classname on your classpath).
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
JAR Viewer and Decompiler - Visual Studio Marketplace
Extension for Visual Studio Code - Browse and display decompiled contents of Java JAR files.
🌐
Appscms
appscms.com › jar-decompiler
Safe Online JAR Decompiler
Java program developers can easily decompile JAR files with our online JAR Decompiler tool to extract source codes and other contents with ease.
Rating: 3 ​ - ​ 4 votes
🌐
Uprootsecurity
uprootsecurity.com › blog › decompile-jar-files-java-guide
How to Decompile JAR Files: Guide for Java Developers
Learn to decompile JAR files with CFR, JD-GUI, and FernFlower. Explore IDE & CLI methods, real-world fixes, and legal tips for Java developers.
🌐
Medium
medium.com › @cvr4314 › cracking-open-jar-files-a-developers-guide-to-decompiling-f9c07f2064c0
Cracking/De-compile Open JAR Files: A Developer’s Guide to De-compiling | by Chandima Veneera Rathnayake | Medium
July 12, 2023 - In IntelliJ IDEA, click on “File” > “Open” and select the folder where you extracted the JAR file contents. Once you’ve opened the folder in your IDE, you can navigate to the extracted Java class files and start exploring the code.
🌐
DEV Community
dev.to › dhanushkadev › decompile-all-the-jar-files-in-given-directory-1j99
Decompile all the jar files in given directory - DEV Community
January 12, 2023 - You can use Procyon decompiler and have a recursive look into folders with the following command. find <jar_files_directory> -name "*.jar" -exec java -jar <procyon_decompiler_location> -jar {} -o <output_directory> \;
🌐
GitHub
github.com › Vineflower › vineflower
GitHub - Vineflower/vineflower: Modern Java decompiler aiming to be as accurate as possible, with an emphasis on output quality. Fork of the Fernflower decompiler.
Examples of Vineflower's output compared to other decompilers can be found on the website. Vineflower can be used from the console or as a library. To run Vineflower from the command line, download the latest release from the Releases tab. You can then run Vineflower with java -jar vineflower.jar <arguments> <source> <destination>. <arguments> is the list of commandline arguments that you want to pass to the decompiler.
Starred by 1.8K users
Forked by 116 users
Languages   Java
🌐
Javainuse
javainuse.com › decomp
Java Decompiler Online
A CLASS file is a compiled .JAVA file created by the Java compiler. It contains bytecode, which is binary program code that is executable when run by a Java Virtual Machine (JVM). CLASS files are commonly bundled into .JAR files, which are included in the $CLASSPATH environment variable for ...
🌐
Codemia
codemia.io › knowledge-hub › path › how_to_decompile_a_whole_jar_file
How to decompile a whole Jar file?
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises
🌐
JetBrains
plugins.jetbrains.com › plugin › 7100-java-decompiler
Java Decompiler - IntelliJ IDEs Plugin | Marketplace
JD-IntelliJ is a Java decompiler for the IntelliJ IDEA. Open a Java class file to see the decompiled code. It is based on the famous JD-GUI's core library JD-Core...