• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Extracting .java files from .class files

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
If I have a jar file x.jar which has y & z classes, how do I extract y.java file from x.jar file ? What is the procedure for this ?
Thanks
Meghna
 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Get the class files out of the jar
jar xf x.jar y.class
jar xf x.jar z.class
Disassemble the class files. If you do not
have a particualar product, use javap from
the JDK.
If you hope to see the code for some class
that you bought, you may find that it has been
obfuscated, i.e. method and variable names changed
to make the disassembled code very confusing.
HTH,
Joe
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This doesn't really belong in the Swing/JFC/AWT forum ( even if you're trying to decompile code that uses these classes... ) So I'm moving it to Java In General (Intermediate).

-Nate

P.S. - Check out DJ Java Decompiler. It uses JAD, is put together well, and has an easy to understand GUI...
 
reply
    Bookmark Topic Watch Topic
  • New Topic