Java Decompiler

Rashmi Patidar May 14, 2021
Java Decompiler

The decompiler is a utility that helps to analyze and decompile the Java byte codes and produce source code from them. Decompile is the exact reverse process of the compile process. The process is beneficial when no source is available, and we can debug the using source code after decompiling the byte code and analyze its behavior.

Since development gets done using Integrated Development Environment (IDE) and hence it’s beneficial to have a decompiler in IDE itself. Search for the string decompiler in the marketplace of freely available IDE’s say Eclipse or Intellij.

For IDE that is Intellij, we can download the plugin from the marketplace. Once the plugin gets in a proper place, we can locate the decompiler in the left sidebar below the maven plugin. Below is the attached screenshot for better understanding.

Decompiler Plugin in Intellij

The decompiler code gets automatically converted to the source code, and we can locate it in the target folder. Below is the screenshot attached for understanding.

Source code after decompilation in target folder

Other available tools to convert byte code to source codes are as below.

Java Decompiler is an online web service along with an actual application. We can decompile any Java 5 and higher version code using the utility. The service provides various options under which we can select the decompiler of our choice from the list. Under this, we have JD-GUI that is a graphical utility and helps to convert the .class files to get Java source code from the same. JD-Eclipse is an eclipse IDE plugin that allows the decompilation of a class file in IDE itself. JD-Core is another open-source utility that recreates source code from the byte code.

Another utility is Procyon that primarily focuses on code generation and analysis. It is an open-source utility and is given by Apache Licence 2. It consists of libraries like core framework, expressions framework, reflection framework, compiler toolset, and a Decompiler. It has its utility which facilitates the process of code generation from the byte code.

For more details, visit the GitHub link -https://github.com/mstrobel/procyon

The Krakatau is one more open-source tool for assembling and disassembling the java byte code. The tool allows users to transform binary code into text format. It even allows users to reconvert the source code to the byte code again. The utility is purely a Python script, which runs when we execute the command.

More details are over the GitHub link - https://github.com/Storyyeller/Krakatau

CFR is another Java decompiler that allows decompiling the byte code of Java up to version 14. The decompiler code is purely written in Java 6 and is easy to execute. We can run it via a command that runs the jar and takes a parameter here, the class name that to decompile.

Further details are over the link- https://github.com/leibnitz27/cfr

Fernflower is yet another such utility available that is still under development. The utility is given by Apache Licence 2. Execution command is as simple as running a jar along with parameters.

For more details visit- https://github.com/fesh0r/fernflower

The DJ Java Decompiler is one of the utility tools that are compatible with windows and its subsequent versions. The utility is powerful enough to correctly decompile the Java applet code from the given byte code. It is a standalone Windows application with a well-defined graphical user interface.

For more details visit- http://www.neshkov.com/

Rashmi Patidar avatar Rashmi Patidar avatar

Rashmi is a professional Software Developer with hands on over varied tech stack. She has been working on Java, Springboot, Microservices, Typescript, MySQL, Graphql and more. She loves to spread knowledge via her writings. She is keen taking up new things and adopt in her career.

LinkedIn