aspose file tools
The moose likes Beginning Java and the fly likes How Can I reverse - Engineer a .class file to a .java file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How Can I reverse - Engineer a .class file to a .java file?" Watch "How Can I reverse - Engineer a .class file to a .java file?" New topic

How Can I reverse - Engineer a .class file to a .java file?

Todd Schmiedeke

Joined: May 10, 2005
Posts: 5
I would like to take an existing .jar file and revert it back to its original state to view the code in the .java files.

1. How do I unjar a .jar file?
2. How do I get a compiled file (.class) back to a .java file?

Marco Davids II

Joined: Nov 02, 2004
Posts: 24
there is a quite a number of decompilers for java class file
just google for Java decompiler

a jar file is just a compressed file which can be decompressed using Winzip or any other similar software

Hope that helps
Robynn Harrington

Joined: Jun 08, 2005
Posts: 4
Todd- please call me... I can't find your number.
Preetham Chandrasekhar
Ranch Hand

Joined: Nov 05, 2003
Posts: 98
Jad is supposed to be a good decompiler....pretty straight-forward as well.

"In theory, there is no difference between theory and practice. But, in practice, there is."<br /> - Jan L.A. van de Snepscheut
Jeff Langr
Ranch Hand

Joined: May 14, 2003
Posts: 799
Under Windows, you should be able to open a JAR file using WinZip. I usually associate the .JAR extension to WinZip.

Or at the command line (assuming you have your JRE bin in your path):

jar xvf file.jar

Enter "jar" to see the full list of options.


Books: Pragmatic Unit Testing in Java, Agile Java, Modern C++ Programming with TDD, Essential Java Style, Agile in a Flash. Contributor, Clean Code.
I agree. Here's the link:
subject: How Can I reverse - Engineer a .class file to a .java file?