wood burning stoves 2.0*
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
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
Author

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

Todd Schmiedeke
Greenhorn

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?

Thanks
Marco Davids II
Greenhorn

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
Greenhorn

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
author
Ranch Hand

Joined: May 14, 2003
Posts: 762
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.

-Jeff-


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