Neither jad nor JODE (on SourceForge) have not been updated to deal with the features introduced in Java 5 (e.g. generics), so that the code they produce will be a good deal different from the original source in any case.
JODE is open source, so that it can be enhanced to produce better output, but it's not a fun or easy proposition.
You may have better luck using a commercial offering, although the comparion on that site suggests that JODE is the best to begin with. [ January 16, 2008: Message edited by: Ulf Dittmer ]
Thank you. The SourceAgain commercial compiler kind of looks promising. I've got an email into their support link to see if it supports verion 50 class files. By the description, though, it looks like it may not.
I somehow missed Joda, though, and I'll give that a try as well.
This looks promising, as it's not based on jad or JODE, and more up-to-date than either. Of course, I gotta ask right away -since you mention the cross-platform nature of wxWidgets- might an OS X version be in the future? If that's beyond what you can (or are willing to) do, would you consider enabling someone else to provide a Mac port?
Note that there's a tool included with the JDK called javap which can disassemble and decompile class files, although it might not be able to completely reconstruct the Java code.
Note that due to type erasure, you most likely will not be able to recover the exact source code if yiou used generics - because the information about the generics usage was thrown away by the compiler. [ February 19, 2008: Message edited by: Jesper Young ]
Originally posted by Jesper Young: Note that there's a tool included with the JDK called javap which can disassemble and decompile class files, although it might not be able to completely reconstruct the Java code.
Unless something changed in Java 6, javap will only emit bytecode, not Java source code. While its output may be useful for someone who has a passing knowledge of bytecode, it can't be fed to a Java compiler. So javap is really just a disassembler, not a decompiler.
Joined: Feb 16, 2008
Exact Ulf. javap emit bytecode only. Once you have the bytecode, there is a long process of reconstruction of instructions 'if ' and statements 'try-catch' and 'synchronize'.