Home Services Blog → Adobe Analytics → Adobe Experience Platform → Adobe Target → AEM → Google Analytics 4 → Segment CDP About Contact

How to Install Java and Run AEM

Install Java and Run AEM Guide

Getting started with Adobe Experience Manager (AEM) requires a properly configured Java Development Kit (JDK). This comprehensive guide walks you through installing Oracle JDK 21, setting up JAVA_HOME, and running AEM on both macOS and Windows platforms.

💡 Prerequisites

You'll need administrator access to your machine and the AEM Quickstart JAR file from Adobe. We recommend using Oracle JDK 21 for optimal performance and compatibility.

Installation Guide

Select your operating system below to see platform-specific instructions:

Installing Oracle JDK 21 on macOS

1

Download Oracle JDK 21

Visit Oracle JDK Downloads and download the macOS DMG Installer for your architecture (ARM64 for Apple Silicon, x64 for Intel).

2

Run the Installer

Double-click the downloaded .dmg file and follow the installation wizard. The JDK will be installed to:

/Library/Java/JavaVirtualMachines/jdk-21.jdk
3

Verify Java Installation

Open Terminal and check that Java is properly installed:

java -version

You should see output like: java version "21.0.x"

4

Set JAVA_HOME (recommended)

Add to your ~/.zshrc or ~/.bash_profile:

export JAVA_HOME=$(/usr/libexec/java_home -v 21)
export PATH=$JAVA_HOME/bin:$PATH

Then reload your shell:

source ~/.zshrc

Running AEM on macOS

5

Create AEM Directory

Create a dedicated folder for your AEM instance and copy the quickstart JAR:

mkdir -p ~/aem/author
cd ~/aem/author
# Copy your AEM quickstart JAR file here
6

Unpack AEM (First Time Only)

Open Terminal and run the unpack command to extract AEM files:

cd ~/aem/author
java -jar aem-quickstart-6.5.0.jar -unpack

This extracts all necessary files without starting the server. Wait for it to complete.

7

Start AEM

After unpacking, you have three options to start AEM:

Option 1: Double-click — Simply double-click the aem-quickstart-6.5.0.jar file. This is the easiest way!

Option 2: Terminal with more memory — For better performance:

java -Xmx4g -jar aem-quickstart-6.5.0.jar

Option 3: Run in background

java -Xmx4g -jar aem-quickstart-6.5.0.jar &
8

Access AEM

Once startup completes (watch the logs), open your browser:

http://localhost:4502

Default credentials: admin / admin

🚀 Pro Tip: Create a Start Script

Create a file called start-aem.sh:

#!/bin/bash
cd ~/aem/author
java -Xmx4g -jar aem-quickstart-6.5.0.jar

Make it executable: chmod +x start-aem.sh

Installing Oracle JDK 21 on Windows

1

Download Oracle JDK 21

Visit Oracle JDK Downloads and download the Windows x64 Installer (.exe).

2

Run the Installer

Double-click the downloaded .exe file and follow the installation wizard. Note the installation path (typically C:\Program Files\Java\jdk-21).

3

Set JAVA_HOME Environment Variable

Follow these steps to set up JAVA_HOME using the Windows GUI:

  1. Press Windows + R, type sysdm.cpl and press Enter
  2. Click the Advanced tab
  3. Click Environment Variables button
  4. Under System variables, click New
  5. Variable name: JAVA_HOME
  6. Variable value: C:\Program Files\Java\jdk-21
  7. Click OK
  8. Find Path in System variables, select it and click Edit
  9. Click New and add: %JAVA_HOME%\bin
  10. Click OK on all windows to save

Important: Close and reopen any Terminal/Command Prompt windows for changes to take effect.

4

Verify Java Installation

Open a new Terminal window (Start → search "Terminal") and run:

java -version

You should see output like: java version "21.0.x"

Also verify JAVA_HOME:

echo %JAVA_HOME%

Running AEM on Windows

5

Create AEM Directory

Open Terminal (Start → search "Terminal") and create a folder:

mkdir C:\AEM\author
cd C:\AEM\author

Copy your AEM quickstart JAR file to this folder.

6

Unpack AEM (First Time Only)

Open Terminal (Start → search "Terminal") and navigate to your AEM folder:

cd C:\AEM\author
java -jar aem-quickstart-6.5.0.jar -unpack

This extracts all necessary files without starting the server. Wait for it to complete.

7

Start AEM

After unpacking, you have two options to start AEM:

Option 1: Double-click — Simply double-click the aem-quickstart-6.5.0.jar file. This is the easiest way!

Option 2: Terminal with more memory — For better performance:

java -Xmx4g -jar aem-quickstart-6.5.0.jar

The first startup may take several minutes as AEM initializes.

8

Access AEM

Once startup completes (watch the console for "Startup completed"), open your browser:

http://localhost:4502

Default credentials: admin / admin

🚀 Pro Tip: Create a Batch File

Create a file called start-aem.bat:

@echo off
cd C:\AEM\author
java -Xmx4g -jar aem-quickstart-6.5.0.jar
pause

Double-click to start AEM easily.

Common Issues & Troubleshooting

⚠️ Port Already in Use

If port 4502 is busy, either stop the conflicting process or rename your JAR to use a different port (e.g., aem-author-p4503.jar).

⚠️ Out of Memory Errors

Increase the heap size: -Xmx6g or -Xmx8g depending on available RAM. AEM performs best with at least 4GB allocated.

⚠️ Java Version Mismatch

Ensure you're running Oracle JDK 21. Use java -version to verify. Also check that JAVA_HOME is set correctly with echo %JAVA_HOME% (Windows) or echo $JAVA_HOME (Mac).

Next Steps

Once AEM is running:

🎯 Need Help with AEM?

WegWorks specializes in AEM implementation and optimization. Contact us for expert consulting on your AEM projects.

Related Topics

AEM Installation Oracle JDK 21 Java JDK Setup Adobe Experience Manager AEM Quickstart AEM Development WegWorks Weg Works AEM on Mac AEM on Windows JAVA_HOME AEM Unpack AEM Author AEM Publish