Skip to content

Instantly share code, notes, and snippets.

@munim
Last active August 27, 2017 07:49
Show Gist options
  • Save munim/c5564bc99ddcb8c51cc23035e41869dc to your computer and use it in GitHub Desktop.
Save munim/c5564bc99ddcb8c51cc23035e41869dc to your computer and use it in GitHub Desktop.

How to debug AEM/CQ5 using Eclipse/IntelliJ

Run AEM/CQ5 instance in debug mode using the following command

java -Xdebug -Xrunjdwp:transport=dt_socket,address=58242,suspend=n,server=y -Xmx1024m -jar .\cq5-author-p4502.jar -nofork

Eclipse configuration

  1. Open Eclipse.
  2. Choose Run > Debug Configurations.
  3. Right-click Remote Java Applications and select New.
  4. Select your AEM/CQ5 project under Project.
  5. Type in the port, in our case 58242
  6. To start a debugging session, double-click your new configuration in the Debug Configurations screen after saving it.

IntelliJ configuration

You just need to install JSR45 plugin in your IntelliJ and do the following

  1. Add a JSR45 Compatible Server
  2. Select Application server as Generic
  3. Provide your host and port that you run in your browser in Remote Connection Settings
  4. Now the important part, select Startup/Connection tab
  5. Select Debug configuration
  6. Put the parameter -agentlib:jdwp=transport=dt_socket,address=58242,suspend=n,server=y in debug remote server JVM settings
  7. Select transport Socket option
  8. Put the port 58242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment