How do I decompile Java classes in Eclipse?
Author: Deron Eriksson
Description: This Java tutorial describes how to decompile Java classes in Eclipse using JAD.
Tutorial created using: Windows XP || JDK 1.5.0_09 || Eclipse Web Tools Platform 1.5.1

Page: < 1 2 3

(Continued from page 2)

We've seen how JadClipse can let us view a decompiled class that came with no source code. Just for fun, let's now see how to attach source code to a jarW file in case we'd like to view the actual source code for a class if we have it available.

To do this, right-click the commons-lang-2.3.jar file and go to Properties.

Right-clicking commons-lang-2.3.jar file and going to Properties

Click the JavaSW Source Attachment option on the left, and enter the Location path to the source code.

Java Source Attachment

NOTE: At this time it's probably a good idea to close and reopen EclipseSW. Otherwise, there's a good chance that the JadClipse Class File Viewer will open rather than the source code file for the class that we select.

After reopening Eclipse, click StringUtils and hit F3.

Hitting F3 on StringUtils class

This opens the Java source code file in Eclipse, along with all the useful comments and things that go along with it.

StringUtils class source code

In this tutorial we've seen how to decompile classes that don't have source code, and we've seen how to view source code for classes where we do have a source code attachment.

Page: < 1 2 3