Mchr3k - JDEclipse-Realign


Update Site


User Guide

Viewing the decompiled source for a class is as simple as opening any class in a jar which doesn't have a source attachment.

Switching between decompiled/regular source for all classes in a jar can be done quickly by clicking the buttons in the toolbar.

  • The buttons in the toolbar look like this:

    These buttons are only visible when a class editor is active or a class, jar package or entire jar is selected in the Package Explorer or Project Explorer.

  • The buttons can be entirely enabled/disabled through the normal Customize Perspective window:

You can also right click on a class within the Package Explorer or Project Explorer view to control decompilation. However, if you choose to open any class in a jar which doesn't have a source attachment, decompiled source will be automatically attached to the jar.

  • When decompilation is disabled:

  • When decompilation is enabled:

  • You can also right click on a package:

  • Or you can right click on a jar:

  • Or you can right click on multiple jars or classes across multiple jars:

The JD Java Decompiler outputs line numbers in comments. These are used by JD-Eclipse Realign to line up the decompiled source correctly. Once this process is complete the line number comments can be optionally stripped out.

Blog Posts

Further details about how this plugin works can be found on my blog:


This project adds the following:

06/01/2013 (1.1.2)

  • Issue 17: Add option to strip line numbers from decompiled source.

10/11/2012 (1.1.1)

  • Issue 12: Restore the JD-Eclipse Realign Class File Viewer to enable classes without source to automatically have decompiled source attached.
  • Restored code to automatically set file type associations every time Eclipse is started. This will force the new editor to be the default viewer for classes (or for classes without source from Eclipse Juno).

03/11/2012 (1.1.0)

  • Issue 6: Add toolbar buttons which allow for decompiled source to be quickly attached/detached.
  • Issue 8: Make context menu work when multiple jars have been selected.

28/08/2012 (1.0.9)

  • Resolve issue 5. Enable context menu in Project Explorer, allow one click enable decompilation, enable context menu on packages and jars.

08/08/2012 (1.0.8)

  • Remove JD-Eclipse Realign editor - treat enabling decompiled source like attaching source. This fixes issues with jumping to elements within a file.

01/08/2012 (1.0.7)

  • Add a custom editor icon.

27/07/2012 (1.0.6)

  • Ensure Eclipse doesn't re-use an existing Class File Viewer.

08/07/2012 (1.0.5)

  • Add "Open Class With" dynamic submenu to choose which editor to open class files with.
  • Add "Attach Source..." action to "Open Class With" dynamic submenu.
  • Fix source caching so that after decompiling a class you can still open the normal "Class Viewer" and see attached source.

05/07/2012 (1.0.4)

  • Alignment for fields and enums in addition to method alignment which was implemented by Alex.
  • Automated file association setup on first startup. In Eclipse Juno the new "class without source" file type is defaulted to JD Eclipse and "class" is defaulted back to the built in class viewer so that real source will be displayed.
  • A single Eclipse update site to download JD-Eclipse along with this project: