Decompile AEM: How to get a jar from AEM

Decompile AEM: How to get a jar from AEM

AEM development is sometimes difficult to get started due to limited documentation. By having some code examples or a clearer understanding of what is under the hood, this could be the difference from good code to great code. Having the ability to decompile a jar can be very helpful in the development process. Decompiling the jar is the easy part. Finding and getting the jar in AEM can be more difficult. There are two ways that this can be accomplished in AEM, with Vault or without Vault.

Check it out!

With Vault (vlt)

  1. Go to http://localhost:4502/system/console/bundles

  2. Search for webservice, click Day Communique 5 WCM Webservice Support

  3. Notice Bundle Location copy the path after jcrinstall: (If you don't see jcrinstall, go to without vlt section)

  4. Open CRXDE Lite and add the copied path. You should see the name of the jar inside that path

  5. Now that the location is confirmed. Go to terminal and vlt down the jar. In my case this is what I used:

vlt --credentials admin:admin co --force http://localhost:4502/crx/-/jcr:root/libs/wcm/webservice-support/install

Without Vault (vlt)

  1. Go to http://localhost:4502/system/console/bundles

  2. Search for webservice, click Adobe Granite Asset API Implementation

  3. Notice Bundle Location path does not have jcrinstall:, instead it has launchpad: So we cannot easily track down the jar file in CRXDE Lite

  4. Look at the bundle number at the left

  5. Go to your terminal and go to /crx-quickstart/launchpad/felix/bundle84

  • In this case we will have to drill down into version0.0 then we see bundle.jar
  • Not all bundles are like this, sometimes there is a /data/install folder and that is where the jar is located

How to decompile a jar

There are a bunch of decompilers out there but I use JD-GUI

Open using JD-GUI

That's it!

Fast Method

  1. Terminal --> /crx-quickstart/launchpad/felix
  2. Use this command:
grep -rnw . -e "com.adobe.cq.mcm.salesforce.SalesforceExportProcess"

Result:

Note: You can supply either a package name or a jar file name

Share this post

0 Comments

comments powered by Disqus