Java .jar and .class De-compilation and recompilation

Java .jar and .class de-compilation and recompilation

if you are familiar with java it is too good but hover you must be have to know that how to write program in java.Java is an advanced language it is mostly used in network based application and for cross platform development the java application execution architecture is as follow

Java code which are saved in .java file are compiled to .class file which basically execute on the JVM for distribution the .class files are packaged in .jar archives which also execute on the JVM so now as our binaries must be .class or .jar files so we have to work on those to reverse it the .class file have the name as that of .java and when the .class file is brought to JVM it frist start to execute main() function if it exists(in libraries there are no main() function) So our starting file in java files must be that one which have main.Now we know that .class is byte code executable on JVM files so we are going here to de-compile it to the .java so we can also use the .jar to be de-compiled the same way de-compilation process is below in simple steps

De-compilation of .Jar or .Class files

Ø First of all go to to the site and download “Java Decompiler
Ø if it does’t exists search in google “Java Decompiler” or Jd-Gui and download it
Ø It is a single stand alone Gui application just double click and open it
Ø An Application will pop up like below one

Ø This is Java Decompiler window
Ø Go to File menu and click on open
Ø Select your .jar or .class file and click on open
Ø And you will see the code as below in Java Decompiler

Ø Go to file and Click on Save all sources if you have opened a .Jar package
Ø The next step is to give name and it would be saved as named given a zip archive

Ø Save it
Ø Now you have successfully de-compiled the byte code
Ø It is now time to make changes in the code according to your needs
Ø Do it and save the .java file
Ø If your file contains too much class and codes you have to use extra tools to get to your required position
Ø Make the changes you want and save file

Recompilation of .java files

The java files compile easily with the java jdk(Java Development Kit) use it and compile your changed .java files. The process is easy but making the required change take a lot of time so you have to do it be patiently. Firstly you have to understand the code many tools can help you in the process there are a lot of free and paid tools those tool also recover the architecture and also to recover the class diagram this is the easiest type of Reverse Engineering you will find a lot of fun as we go further and further read on you can do it and you will learn a lot
Ø Keep in mind java program always start from main(String[] arg) function


  1. Really Nice Information,Thank You Very Much For Sharing.
    Web Development Company

  2. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training in India . Nowadays Java has tons of job opportunities on various vertical industry.

  3. Do not think how to make long and difficult, just come to us for BGAOC all slots are good Come and win with us

  4. Big data is a term that describes the large volume of data – both structured and unstructured – that inundates a business on a day-to-day basis. IEEE Projects for CSE in Big Data But it’s not the amount of data that’s important. Final Year Project Centers in Chennai It’s what organizations do with the data that matters. Big data can be analyzed for insights that lead to better decisions and strategic business moves.

    Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Corporate TRaining Spring Framework the authors explore the idea of using Java in Big Data platforms.
    Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

  5. Tip til køb af en kopi her. Folk bruger meget tid på at søge efter køb billige Audemars Piguet på Internettet, så det er nemt at købe en god ting.