Overview

JD-IntelliJ

JD-IntelliJ is a plug-in for IntelliJ IDEA, initiated by Brice Dutheil. It uses the Java Decompiler binaries It allows you to display all the Java sources during your debugging process, even if you do not have them all. Currently, the project is under development. The Java sources are hosted on Bitbucket. Your contributions are welcome. Also note that it is possible to decompile jars/classes with JD-GUI (can be found on the official site).

Notes

It is the official Java Decompiler plugin for IntelliJ IDEA. The plugin should work from IntelliJ IDEA 10.5.x to the latest stable version (12 as of this writing).

Last but not the least, all the credit for decompilation stuff must go to Emmanuel Dupuy, who is the author of Java Decompiler.

Screenshots

JD-IntelliJ in action

Supported Platforms

  • Windows 32/64-bit
  • Linux 32/64-bit
  • Mac OSX 32/64-bit on x86 hardware

Installation

From the JetBrains repository

The plugin is deployed on the publin JetBrains IntelliJ repository, to install it go to the Settings dialog window > Plugins pane > Browse Repositories dialog window, then search for Java Decompiler.

From the zip archive

It is also possible to install JD-IntelliJ from a file (if compiled from the source), to the Settings dialog window > Plugins pane > Install Plugin from disk...

Don't download from Bitbucket! The Bitbucket link is the zipped mercurial repository, not the actual plugin. You can find the latest version on the IntelliJ plugin site.

Windows Platform Prerequisites

The native library, included into JD-Eclipse for Windows, has been built with Microsoft Visual C++ 2008 Express Edition. Some runtime components of Visual C++ Libraries are required to run the decompiler. You can download and install them from the Microsoft Web site :

Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)

Microsoft Visual C++ 2008 SP1 Redistributable Package (x64)

Development

First steps

Note that the source code is compiled against the IntelliJ 11 API, the JetBrains introduced a few backward incompatible changes in later versions that would require changes and incompatibilities for earlier verison of IntelliJ. In order to maintain this compitibility for the time being the plugin will still be compiled against IntelliJ 11, compilation should work against a community edition of IntelliJ 11 (which can be found here).

  1. Download the project from Bitbucket.
  2. Import it on IntelliJ IDEA.
  3. Create a new configuration with the type "plugin". Don't forget to set up an IntelliJ IDEA Plugin SDK.
  4. Run the new configuration.
  5. Copy native library on the sandbox folder if needed. (It shouldn't be necessary anymore, as the loading code and the IntelliJ project file jd-intellij.ipr has been tweaked to copy over the native binaries, see Resource Patterns in the Compiler settings)

Building it

Don't use the IntelliJ internal plugin deployment feature Prepare plugin module 'jd-intellij' for deployment, it doesn't deal well we have native binaries. in order to deal properly with this matter an ant build script has been created.

So, to create the plugin zip archive (with the custom repository file) in the deploy folder, enter the following at root of the project :

ant make

_note for Linux/Unix: change jd-intellij-unix.properties to reflect the IntelliJ Installation path (default to /usr/local/intelliJ )

To package the archive you should also setup your the properties in your platform related file jd-intellij-osx.properties or jd-intellij-win32.properties, you'll find interesting properties :

# IntelliJ 11 path
idea.home=/Applications/IntelliJ IDEA 11.app
jdk.home=${idea.home}/../../System/Library/Java/JavaVirtualMachines/1.6.0.jdk


# Version of the plugin
current.version=0.1


# Base URL where the plugin ZIP file will be deployed
plugin.deploy.url=http://arkey.fr/jd-intellij

For development purpose, you can take a look here :

Java Decompiler Disclaimer

Copyright © 2008-2012 Emmanuel Dupuy.

THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.