How to Start AEM in Debug Mode

How to start Adobe Experience Manager (AEM) in debug mode for applications running in a remote or local AEM server.

Remote Debugging JVM Parameter

Per the Adobe documentation, to Debug an AEM app using eclipse, start AEM with this JVM parameter


Option 1

For example, add the parameter to the crx-quickstart/bin/start script CQ_JVM_OPTS environment variable


if [ -z "$CQ_JVM_OPTS" ]; then
	CQ_JVM_OPTS='-server -Xmx2048m -XX:MaxPermSize=256M -Djava.awt.headless=true -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n'

-z means zero length. for example, if [ -z "$CQ_JVM_OPTS" ]; then means if $CQ_JVM_OPTS is empty. This check is for Option 2 described below.

Option 2

As documented in the start script comments, You can set the CQ_PORT and other variables using the command line when calling the start script. e.g.,

# The following variables may be used to override the defaults.
# For one-time overrides the variable can be set as part of the command-line; e.g.,
#     % CQ_PORT=1234 ./start

In this example, we’re setting the CQ_JVM_OPTS variable using the command line:

cd crx-quickstart/bin

CQ_JVM_OPTS='-server -Xmx2048m -XX:MaxPermSize=256M -Djava.awt.headless=true -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n' ./start
comments powered by Disqus