Tuesday, May 22, 2018

Install and Configure Java Decompiler ECD In AnyPoiintStudio 7

Introduction

ECD, Enhanced Class Decompiler, so far is the best java class decompiler plugin available for Eclipse and Mule AnyPointStudio. It support JAD, JD, FernFlower, CFE and Procyon. The best of all is that it allows us to debug the code which we don't have source code. For details, please refer to the article here

The ability to debug code without source code is critical to problem solving. In particular, nowadays, most documentation for Mule 4 are not complete. In this blog, I am going to cover the installation and configuration. For the installation, I will build the source code and install from my local. In this way, we learn the details about Eclipse plugin. And if we want to improve the plugin, we can change the code as we want.

The ECD works out of box for Mule Anypoint Studio 6.x. However, it will not work for 7.x. Actually this is caused by underlying Eclipse 4.7.x. This is the main reason I publish this article.

Build ECD Plugin

To build the ECD plugin we need to clone two repositories from github. The procedures are as the following (assume you have git directory under $HOME)
cd git
mkdir ecd
cd ecd
git clone https://github.com/ecd-plugin/ecd.git
git clone https://github.com/ecd-plugin/update.git
cd ecd
mvn clean package

Install And Configure ECD

After the successfully building the plugin, we can install it. Help --> Install New Software --> Add,
click Local
choose the update directory
You should see the following:

click Open
type ECD in the Name
click OK
Now click Finish and install as normal. After restarting the AnyPointStudio, we need to configure the ECD. Note that, it would not work out of box. First, let's check if the ECD is installed. Preference --> Java.
If you see the above, then the ECD is installed correctly. Now, if you try to look a java class, the source code would not be displayed. We need to do the following:
In the preferences, search File Assoc and client *.class, make the lower panel looks like the following
Do the same amke the *.class without source looks like the following:
Now, if you click any class, the Studio will display the source code. Per the author's article, FernFlower and JD are highly recommanded. FernFlower supports all Java versions, but JD is the fastest.

No comments:

Post a Comment

Anypoint Studio Error: The project is missing Munit lIbrary to run tests

Anypoint Studio 7.9 has a bug. Even if we following the article: https://help.mulesoft.com/s/article/The-project-is-missing-MUnit-libraries-...