Wednesday, September 15, 2010

The sad state of Java decompilers

There are no good complete Java decompilers it seems. And this is sad.


I use java decompiler often. Because I am curious how something works. Because sometimes I need to modify/fix something I don't have the code for. Because I need to prove a bug is in a third party component. Because I need to be able to find a way to find a workaround to a broken system. Etc.

Yet to my knowledge there's no more world class Java decompiler:

  • jad (http://www.varaneckas.com/jad), while still one of the best, hasn't been maintained properly since 2001! Still one of the best. But it doesn't support latest byte code formats.
  • Java Decompiler (http://java.decompiler.free.fr/) is not bad, fast, maintained but not open source and lacks many basic options to my taste (e.g. command line...). It will not be open sourced, etc. Will it end like jad ? or will it replace it as the current freeware best decompiler ?
  • fernflower (http://www.reversed-java.com/fernflower/) doesn't work anymore. And it's based on a web service. Which cannot be used sometimes.
  • jdec (http://jdec.sourceforge.net/) lacks basic java 5 features (enums, ...), the command line version relies on a property file, and is slow, etc...


etc. etc. http://stackoverflow.com/questions/2718814/any-maintained-open-source-java-decompiler

But most importantly, none of the programs above produce compilable code. That means I have to revert to javap again to fill in the gaps. Even for things that don't seem too hard to get.

Now that Java is as much a platform as a language, it would be nice to have a proper (and hopefully open) decompiler that supports java 5 (released in 2004), and optionally other languages (groovy, scala, etc).

Strange that noone started something like that at codehaus or other Apache license friendly organization.

2 comments:

  1. AndroChef Java Decompiler is based on fernflower as its decompiling engine: http://www.neshkov.com/ac_decompiler.html

    ReplyDelete
  2. Hi,
    I put online 6 Java decompilers: Jadx, fast and with Android support, CFR (supports Java 8), JDCore (very fast), Procyon, Fernflower and JAD (very fast, but outdated).

    One may use them without installation here: http://www.javadecompilers.com/

    Regards,
    Andrew

    ReplyDelete