SoFunction
Updated on 2025-04-10

Detailed explanation of what tools are available in Java that can decompile code

In Java, there are many tools that can be used to decompile code. The following are some common decompilation tools and their features:

-GUI

  • Full name:Java Decompiler GUI
  • Features:

a. A lightweight graphical tool.
b. You can directly open the .jar or .class file to view the decompiled code.
c. Supports simple class browsing function and is easy to use.

  • Use scenarios:Quickly view the source code of the .class file and check the compiled code logic.
  • Download address: /java-decompiler/jd-gui

  • Full name: CFR Decompiler
  • Features:

a. Focus on decompiling Java 8, Java 11 and Java 17, supporting many modern Java features.
b. Supports decompilation of new features such as lambda expressions and modules.
c. Command line tools suitable for integration into automation toolchains.

  • Use scenarios:Decompile modern Java features such as lambdas and modules.
  • How to use:
java -jar  
  • Official website address: /other/cfr/

Decompiler

  • Features:

a. Supports syntax for modern Java versions (including Java 8 and Java 11).
b. Decompilation effect of complex generics, nested classes, switch, etc. is good.
c. Provide a library that supports integrating decompilation functions into its own tools.

  • Use scenarios:It is necessary to accurately handle complex syntax such as generics and anonymous classes.
  • How to use:
java -jar  
  • Official website address: /mstrobel/procyon/downloads/

  • Features:

Developed open source decompiler, built-in for IntelliJ IDEA.
b. The decompilation results are of high quality and can handle modern Java features.
c. Can be integrated into Gradle and other toolchains.

  • Use scenarios:Developers using IntelliJ IDEA will automatically decompile when viewing .class files.

  • Open source address: /JetBrains/intellij-community/tree/master/plugins/java-decompiler/engine

(Java comes with tools)

  • Features:

The included disassembly tool is located in the bin directory.
b. It cannot be decompiled directly to source code, but it can display bytecode and method signature.
c. Very useful for understanding Java bytecode structure.

  • Use scenarios:Check the bytecode structure or method signature of the .class file.
  • How to use:
javap -c MyClass

Viewer

  • Features:a. Integrate multiple decompilation tools (such as CFR, Procyon, and Fernflower).
    b. Provides a visual interface to view multiple decompilation results at the same time.
    c. Support ASM code editing and viewing bytecode.
  • Use scenarios:The results of multiple decompilation tools need to be compared or bytecode edited.
  • Official website address: /

  • Features:a. A Python-based Java bytecode decompilation tool.
    b. Focus on decompiling more complex structures.
    c. Compared with other tools, it supports custom decompilation logic.
  • Use scenarios:It is necessary to study bytecode or custom decompilation.
  • Open source address: /Storyyeller/Krakatau

(Java Decompiler)

  • Features:a. It is an earlier decompilation tool, but it has not been updated anymore.
    b. For simple .class files, it still has some reference value.
  • shortcoming:Unable to handle complex features (such as generics, enumerations) in Java 5 and later.
  • Download address:The old version can be found through unofficial mirrors.

How to choose a tool?

tool Advantages Scene
JD-GUI Simple and easy to use, graphical interface Quick view.classdocument
CFR Support modern Java features Decompile Java 8 and above
Procyon Generic and anonymous classes are supported well Decompilation of generics and complex syntax
Fernflower IntelliJ IDEA built-in IDEA users' first choice
Bytecode Viewer Strong comprehensiveness, supports a variety of tools Compare multiple decompilation results or edit bytecode
Javap JDK comes with tools, bytecode level analysis Check method signature or bytecode structure
Krakatau Customized and enhanced, supporting complex structures In-depth research on bytecode or customization requirements

Summarize

This is the article about what tools in Java can decompile code. For more related Java code decompilation tools, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!