Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Todd Schmiedeke
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Todd- please call me... I can't find your number.
 
Preetham Chandrasekhar
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jad is supposed to be a good decompiler....pretty straight-forward as well.
 
Jeff Langr
author
Ranch Hand
Posts: 799
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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-
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic