aspose file tools*
The moose likes Beginning Java and the fly likes How to get .java file from .class file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to get .java file from .class file?" Watch "How to get .java file from .class file?" New topic

How to get .java file from .class file?

Pawan Rao
Ranch Hand

Joined: Dec 29, 2005
Posts: 30
To get .class file from .java, we have javac.
But, how do we get .java file if we have only the .class file?

Stop not till the goal is reached...
Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

[My Blog]
All roads lead to JavaRanch
Tauri Valor
Ranch Hand

Joined: Aug 03, 2005
Posts: 166
You can use Java Decompiler tools for this. One such tool is jad.
Search Google for jad.

A Moment's insight is sometimes worth a Life's experience.
Pawan Rao
Ranch Hand

Joined: Dec 29, 2005
Posts: 30
Thanks a lot.
Gadi Reddy

Joined: Jan 10, 2006
Posts: 21
By using Java Decompiler we will get .java file .
but the thing is we are not getting exact java file( but we will get whatever we write the java file apart from that we will get some system generated code also , but no problem.
Ashan Ranasinghe

Joined: Oct 06, 2004
Posts: 8
you could also use jcavaj

thats a cool tool.

also the jdk comes with its own tool but thats not so good

I agree. Here's the link:
subject: How to get .java file from .class file?
Similar Threads
Class files related
from class file to java file
Identifying Class Name - As in Editors
How to get Java file from .class file ?
why are JAR files created