Thursday, May 28, 2009

Best Java Decompiler

Recently I am working on a UK e-Science project which uses BPEL to orchestrate web services and submits computational jobs to a condor pool. The source code of some of those web services is missing (great!), so I have to decompile the class files in order to make necessary changes.

In my pursuit of the "best" java decompiler, I first tried JD. It is free. But in my use case, it generates some Java code that can not be compiled. Then I tried DJ. It is good, but it only allows for 10 free trials. Each invocation of DJ is considered to be one trial. After that you have to purchase it.

I hadn't been very happy until I found Jad. Jad did my job. And it turns out that Jad is behind many Java decompiler GUIs such as DJ, Cavaj, and JadClipse, an Eclipse plugin. I am quite happy with Jad even without a GUI to drive it.

It is interesting to see JD and Jad were implemented in C++. Won't it be better for Java programmers to have a Java decompiler written in Java?

3 comments:

Sundar Srinivasan said...

There are some excellent open source Java decompilers written in Java, like Mocha, JReversePro, JCavaj, etc. Out of these, Mocha produced the most readable for my case, although it hangs at times.

Anonymous said...

I was also googling for the "best" java decompiler and I found this one:
http://java.decompiler.free.fr/

It works much better than mentioned by Sundar, for it handles try/catch more or less properly.

Anonymous said...

Wake up. JAD can't be written in java because managed languages are slow and unpredictable.