Day 7 of 40
The AEM SDK and Local Runtime
Quickstart jar, run modes, and your first local instance
By the end of today you should be able to
- Start a local AEM SDK Quickstart in author and publish mode
- Explain what run modes are and how they are set at startup
- Describe the difference between the AEM SDK and a licensed Quickstart jar
- Know where the local repository, logs and crx-quickstart folder live
The AEM SDK
For Cloud Service development you do not install "AEM". You download the AEM SDK from Adobe's Software Distribution portal. It contains two things:
- The Quickstart jar — a local AEM runtime that matches the Cloud Service release.
- The Dispatcher tools — a local Dispatcher you can run in Docker (tomorrow's topic).
The SDK is refreshed regularly to track Cloud Service. Keeping yours current matters more than it used to, because Cloud Service moves underneath you — a bug that only reproduces on an old SDK is usually a bug that has already been fixed upstream.
Starting an instance
The Quickstart is a self-extracting jar. Put it in a folder, name it to encode the port and run mode, and run it:
mkdir -p ~/aem-sdk/author
cp aem-sdk-quickstart-*.jar ~/aem-sdk/author/aem-author-p4502.jar
cd ~/aem-sdk/author
java -jar aem-author-p4502.jar
On first run it unpacks into a crx-quickstart folder beside the jar and asks you to set
the admin password. Conventional ports are 4502 for author and
4503 for publish. Run publish the same way in a separate folder with a jar named
aem-publish-p4503.jar.
AEM parses the jar's filename. aem-author-p4502.jar sets run mode author and port 4502. Rename it carelessly and you get a publish instance where you wanted an author, which is a genuinely confusing five minutes.
Run modes
A run mode is a label on the running instance that selects which configuration applies. There are two independent axes:
- Tier:
authororpublish. Fixed at first start and effectively permanent for that instance. - Environment:
dev,stage,prod. On Cloud Service these are set by Adobe per environment.
They combine, and OSGi configuration folders are named accordingly:
ui.config/src/main/content/jcr_root/apps/wknd/osgiconfig/
config/ # all instances
config.author/ # author only
config.publish/ # publish only
config.author.dev/ # author on dev only
config.publish.prod/ # publish on prod only
More specific wins. This is how you point at a test payment endpoint on dev and the real one on
prod without a single if in your Java. You will use this heavily on day 30.
You can also set run modes explicitly at startup:
java -jar aem-author-p4502.jar -r author,dev,local
What lands on disk
crx-quickstart/repository/— the actual Oak repository (segment store). This is your local content.crx-quickstart/logs/error.log— the log you will read most.request.logandaccess.logsit beside it.crx-quickstart/install/— drop a package or bundle jar here and it installs on startup. Handy for service packs.
Deleting crx-quickstart and re-running the jar gives you a clean instance in a few minutes. Local AEM is disposable — treat a broken local repository as a thing to replace, not to repair. Your code is in Git; your local content is not precious.
SDK vs the classic Quickstart
If you also work on AEM 6.5, that uses a licensed Quickstart jar plus a license.properties
file, and it supports things Cloud Service does not (like writing to /apps at runtime, and
classic /etc structures). The SDK Quickstart deliberately enforces Cloud Service's rules
locally so that what works on your machine also works in the pipeline.
One jar per instance, named to encode tier and port. Run modes select configuration; more specific wins. The local repository is disposable.
Watch
Adobe's own videos for this topic. They load only when you press play.
Read on Experience League
The primary sources these notes are drawn from.
Your notes
Saved automatically to this browser.
Check yourself
10 questions on today's material. 80% to pass.