Decompiling a Java .CLASS file?

clamum

Lifer
Feb 13, 2003
26,252
403
126
I accidentally f'ed up one of the source files to a Java project I have to do for a class. I was trying to tar up some files and forgot the name of the tar file, which ended up being the name of a .java file so it got hosed.

Anyway, I still have the .class file so I would like to try to decompile it instead of re-typing the thing over again. It's not a huge file, but I'm guessing decompiling would be easier.

Does anyone know of any good, and free, software that will do this? Thanks.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
I think this one has worked for me before but it wasn't on a recent version of java. No idea how it'd handle 1.5. It seems like everyone and his dog wanted to write a decompiler 10 years ago and they've mostly gone out of date :( Being such a simple little tool, I think it should come with the jdk.
 

Argo

Lifer
Apr 8, 2000
10,045
0
0
jad.exe worked for me in the past. It doesn't work too well with 1.5 java (gives some warnings) but the source code appears to be ok.
 

clamum

Lifer
Feb 13, 2003
26,252
403
126
Thanks guys. I tried JAD out and despite a message saying the class file version wasn't supported, JAD converted it to a .java file. I'll have to change around about a quarter of the code but it will be better than re-writing the assignment. :)