File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Extracting .class to .java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Storm Applied this week in the Other Open Source APIs forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Extracting .class to .java?" Watch "Extracting .class to .java?" New topic

Extracting .class to .java?

Salim Sentosa

Joined: Oct 29, 2001
Posts: 6
I accidently deleted a .java class, but I have the latest .class file.
Is it possible to re-convert it back?
If so how? if not... o'well, start over.
Thanks in advance!
Jorge Phillips
Ranch Hand

Joined: Jun 03, 2001
Posts: 43
Try a Java decompiler such as Mocha or Crema. Decompile your class into source code and comment it again.
You can get a free version of an old beta of Mocha from This is probably enough for retrieving your deleted .java file. Of course you could also buy a commercial decompiler of which there are quite a few.
Good luck.
Salim Sentosa

Joined: Oct 29, 2001
Posts: 6
I did a search on, and found a great one!
Free too. Try here:
Thanks for the hint allowing me to search!
I agree. Here's the link:
subject: Extracting .class to .java?