Some friends complain that they can’t see the underlying source code when using their company’s closed source framework. Try some Java decompiler tools.

Here’s an example of how to use these decompiler tools.

JAD

Suppose we wanted to look at the source code for Graphics2D at line 42 in Eclipse:

CTRL + left directly into the source is invisible.

You can use an open source tool, JAD, to decomcompile the source code. Introduce the JAD wiki: en.wikipedia.org/wiki/JAD_ (s)…

Eclipse has a corresponding plug-in, which can be downloaded from this link:

Jadclipse.sourceforge.net/wiki/index….

1. Depending on the version of Eclipse you are using, go to the link above to download the corresponding plug-in.

2. Download the decompiler execution file based on the operating system type. On my Windows system I downloaded JAD. Exe.

3. Place the JAD plug-in in the Plugins folder of Eclipse.

4. Place JAD. Exe in the bin folder of the JRE directory.

5. Restart Eclipse. In the menu path Windows->Preference->Java, you can see a new option JadClipse. Here we maintain the absolute Path of JAD. Exe in step 4 to the field “Path to decompiler”.

6. Now select a class and press F3 to see the decomcompiled Java source code for JAD.

JD-GUI

Easy to use, window is an executable file.

Double-click jd.exe and drag the.class file you want to decompile into jd’s window:

JD will automatically decompile and display the source code:

Maven automatically downloads the source code of dependent packages

If your Java project manages its dependencies through Maven, it is very easy to view the source code of the dependency package:

The source code files for dependencies can be automatically downloaded from the Download Sources right-click menu.

For example, my Java project’s POM.xml defines the cglib library dependencies:

After triggering the download of the source code file:

It’s easy to find the source file you just downloaded by going to my local repository and modifying time by package pathname or folder.

For more of Jerry’s original technical articles, please follow the public account “Wang Zixi” or scan the following QR code: