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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "class file to source file" Watch "class file to source file" New topic

class file to source file

saravanan ragunathan
Ranch Hand

Joined: Aug 02, 2010
Posts: 84
can i convert class file to source file

"I Love Java Ranch"
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

By using a decompiler like jad.

[My Blog]
All roads lead to JavaRanch
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15094

You can indeed do that using a decompiler, but don't expect that the output will be exactly the same as the original source code. Some information, like names of local variables, is lost in the compilation process, so it's impossible to get those names back by decompiling.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: class file to source file
It's not a secret anymore!