Working with Clojure, I've often run into situations in which I've needed to decompile Java classfiles. This is especially true when working with packages that break backward compatibility1 (I'm looking at you, Kafka).

Often, the most straightforward way to track down a bug is to look at source code, and if only bytecode is available, it's time to bring in the decompilers. There are a a number of high-quality Java decompilers available today:

and more. This is a far cry from a mere decade ago, when the best decompilers were quite poor and often proprietary.

Most of these decompilers are command-line tools, however, with a few having third-party GUIs (e.g. JD-GUI for JD-Core, Luyten for Procyon). Fernflower is somewhat of an exception–it's a plugin, designed for use inside of IntelliJ IDEA.

Since relying on third-party apps is not The Emacs Way, I decided to put together a package, JDecomp, that makes using various decompilers easy. It currently supports CFR and Fernflower, with intended support for more Java decompilers in the future.

Try it out and let me know what you think. Happy hacking!

Footnotes:

1

Which is very much against Java culture. For more on why backward compatibility should never be broken, see Rich Hickey's keynote from Clojure/conj 2016.