How To Read Source Code From JAR File

Whether for what purpose it is, being able to read source code from a jar file could be really useful. For example, if you’re having trouble importing jar files into your IDE, you can read the source code instead.

The good news is that you won’t have to even break a sweat to do this. There is a software called Java decompiler that will do the work for you. Here’s the website Java Decompiler

The main purpose of this software is to decompile and analyze Java “byte code”.

There are 4 type of this Java Decompiler:

  • JD-Core : is a library that reconstructs Java source code from one or more “.class” files. JD-GUI and JD-Eclipse includes JD-Core
  • JD-GUI : a standalone version of the Java Decompiler which a graphical utility that displays Java source code of “.class” files.
  • JD-Eclipse : a Java Decompiler plugin for the Eclipse IDE.
  • JD-Intellij : a Java Decompiler plugin for the Intellij IDE.

But, now we’ll take a look on the JD-GUI software. Now you need to download the software like this :

Click on the Download Tab
Download the JD-GUI based on what OS you have

Now after downloading the JD-GUI, open the program and it should look like this :

click File” tab, and then click “open file”. Now choose what jar file you want to decompile and click open.

Voila! Now you can copy the source code from you jar file.

read source code from jar file

Published by

Rafif Santika

The programming language that I specialize in is Java, because I think Java programming language is more universal and of course because I like it regardless of any reason.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.