Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

class files to source code

  Asked By: Hayfa    Date: Jun 04    Category: Java    Views: 2639

I heared a lot of softwares available in the
market which convert the class file into original
How it is possible? If it is so. What about the
security? I am in confusion how they will get original
file from source file.
Any on help me to know this.
If possible can u list me a few software



4 Answers Found

Answer #1    Answered By: Indie Williams     Answered On: Jun 04

it is possible due to reverse engineering.

you can find one of such s/w from net named DJ java decompiler.

Answer #2    Answered By: Kuhlbert Schmidt     Answered On: Jun 04

The process is called de- compilation. I am attaching a tool here which is
pretty good. It is a utility called JAD. You have to run it like this: jad
<class-file-name.class> It will create a file  called <class-file-name.jad> You
can rename it to <class-file-name.java> However, the variable names that you
give (object names or string names) are not converted as they are, but the tool
converts the names into something that it can. e.g. if your variable name is Car
oMFCar, it might write it like Car car. Still, it is a pretty good tool. It is
possible because, the sun has openly declared structure of class  files in it's
specification. So anybody can decompile the class file if one has access to

Answer #3    Answered By: Maria Hughes     Answered On: Jun 04

it is interesting. could it possible for you to tell us how to use it. any

Answer #4    Answered By: Damian Jones     Answered On: Jun 04

I already sent the the tool with my last mail. I am sending it back again.

1) Extract the jad.exe and place it in any directory.
Add that directory name to your classpath.
2) If you have a .class file  and want to get the .java file of that, say u have
myFirst.class file then either add the directory which contains
to your classpath or go to that directory and issue the following command
jad myFirst.class
You will find myFirst.jad file created in the same directory. This is
but your .java file

I hope that was what you were asking for

Didn't find what you were looking for? Find more on class files to source code Or get search suggestion and latest updates.