• 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

Decompiling Java Class Files

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any way to decompile a class file to get the Java code without using any software like DJ Decompiler etc.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I'm not sure how you'd even read the bytes of the class file without some sort of "software". It's tempting to start to list hopelessly impractical and silly low-level procedures for doing this. But to save time, I'll assume you're willing to at least use basic tools provided with Sun's own JDK - namely, javap. You can use this to convert a class file to a sort of assembly language for the JVM, which is described in the JVM Specification. It's possible to look through this carefully and, using your own brain, figure out what a program is doing. Unfortunately it's also slow and tedious, and error-prone for most of us. Which is why people developed programs like JAD. So I'd say yes, it's possible - though I'm not sure why anyone would want to.
 
Anu Pillai
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jim,

The thing is that I need to look at the source code of a class to debug a partcular issue and I dont have the Java File. And I am unable to download anything from the internet. Thats why I insisted on getting the class file without using any software. I thought that there would be something available in the JDK. Thanks for the info.
 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www.download.com/DJ-Java-Decompiler/3000-2417-10046809.html?part=dl-DJJavaDec&subj=dl&tag=button

Seems to decompile class files. However, if you want to decompile exe files, the only source code you will get is in assembler.
reply
    Bookmark Topic Watch Topic
  • New Topic