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 java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java" Watch "java" New topic


EKAMBARAM Ragothaman

Joined: Feb 02, 2001
Posts: 3
How to convert java .class file back to .java file

Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
go to your jdk direcotry there is a file located called javap.exe run that file and supply a class file which you want to convert back to the source file. It should do a trick.

Val SCJP <BR>going for SCJD
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

Really Val Dra? I heard it was easy but I didnt know it was that easy!
A correction. the file is in the /bin subdirectory.
[This message has been edited by Randall Twede (edited February 02, 2001).]

Visit my download page
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439

Depending on a contion you supply as an argument you get a list of what you want.
Pravin Panicker
Ranch Hand

Joined: Oct 05, 2000
Posts: 62
Well javap does not give your complete java file back only method declarations .
For your complete code you can download srcagain an exe and run it passing the class file name .Redirect the output to a file and you get your java file back!
url :

Pravin R Panicker<br />SCJP,SCWCD
I agree. Here's the link:
subject: java
It's not a secret anymore!