How to Decompile Java Classes

Java class files are compiled bytecode files that could be loaded and run on a JVM or a Java Virtual Machine. To generate a Java source file from a Java class file, you will need a Java decompiler.

Why do we need to decompile Java classes ? Well, I do it to study how the Java compiler optimises my code.

Below are the list of Java decompilers that I use:

  • JAD Java Decompiler – the official site for this decompiler has expired, but you can find a mirror site here.
  • JD-GUI – that seems to support jdk 1.6 and it’s my personal favourite

jd-gui java decompiler

Get a copy of JD-GUI, run the executable and open a Java class or a JAR (Java archive) file and the decompiled code can be viewed within the JD-GUI itself. There is also an option to save the decompiled code into Java source files.

DISCLAIMER: THE ABOVE ARTICLE IS MEANT FOR EDUCATIONAL PURPOSES ONLY. I DO NOT PROMOTE OR SUPPORT ANY KIND OF REVERSE ENGINEERING OF COPYRIGHTED MATERIAL OR CONTENTS. I AM NOT RESPONSIBLE FOR ANY LEGAL ISSUES YOU ENCOUNTER IF YOU FOLLOW THE ABOVE GUIDES/INSTRUCTIONS. I AM NOT RESPONSIBLE OF ANY OUTCOME, LOST OF DATA OR ANY DAMAGES RESULTED DUE TO THE ACT OF YOU PROCEEDING WITH THE ABOVE GUIDES/INSTRUCTIONS.

ibrahim = { interested_in(unix, linux, android, open_source, reverse_engineering); coding(c, shell, php, python, java, javascript, nodejs, react); plays_on(xbox, ps4); linux_desktop_user(true); }