AEM Setup Part 1 : How to Install AEM Locally on Windows.

This is Part 1 of the AEM setup series.

Prerequisites

You will need to have the AEM install jar and the licence file available, before you install AEM you will need to make sure you have Java installed. The two versions of Java currently supported by AEM are Java 8 and Java 11.

To check if java is already installed open a new terminal and type

java -version

If Java is not installed you will receive a message similar to the below. If it is installed you can skip to the next section.

Go ahead and download java from https://www.oracle.com/java/technologies/downloads. (you can also use other opens source versions of java such as Amazon Corretto or Open Jdk if you don't want to use the oracle version)

Double click the downloaded .exe to load the installer. Follow the steps on screen and complete the installation.

Create a new system variable called JAVA_HOME with the the path to your java installation - for example - C:\Program Files\Java\jdk-11.0.13.

Add the value %JAVA_HOME%\bin to the path variable.

From the command prompt run: java - version to confirm the installation - (you may need to restart the terminal to pick up the new environment property)

Install AEM Web Server

Create a new folder to hold your aem instances and add an author, publish and dispatcher folder.

In the author folder add the AEM jar and licence file - rename the jar aem-author-p4502.

In the publish folder add the AEM jar and licence file - rename the jar aem-publish-p4503  (You can develop most the time without ever having the publish instance installed. However its good to have setup incase you do need it.)

By naming the files this way we will set the author/publish run modes and the port the site is hosted on.

Double click the jar's to start the installs.

When complete your browser will open with the login screen - use the default username and password to login (admin, admin).

Install Packages

If you want to install package/bundles on startup you can create a folder in crx-quickstart called install. Any packages you drop in here will installed. I have used this folder to install the AEM service pack.

Replicate Service Pack to Publish

To install the a service pack on the publish instance you can use the replication feature within the package manager.

Find the service pack and from the more menu, select replicate.

No Sample Content

By default AEM will be installed with sample content, this is useful as a reference when developing but when you setup a production environment you will want to remove this.

AEM provides the following installation runmodes

  • author
  • publish
  • samplecontent
  • nosamplecontent

To apply the run mode you can start the install via the command line, passing in the nosamplecontent run mode.

java -jar aem-author-p4502.jar -r nosamplecontent

Stop and Start AEM

To start aem you can use the start.bat file created with in.

crx-quickstart/bin

Java 11 Considerations

You will need to update the start.bat file for java 11 to modify the JVM options.

Remove this as its been removed in JDK 8 +

-XX:MaxPermSize=256M

Add the following JVM options

-XX:+UseParallelGC -Dnashorn.args=--no-deprecation-warning --add-opens=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.jrt=ALL-UNNAMED --add-opens=java.naming/javax.naming.spi=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED

-XX:+UseParallelGC - This is for performance improvments in the garbage collector - see https://www.baeldung.com/jvm-garbage-collectors

The rest supress warnings and illegal reflective access caused by java's module system.

Futher Info

Calling the help function on the quickstart jar will show you the options available from the quickstart.jar

java -jar .\aem-author-p4502.jar -help

This also includes the file naming options used earlier in this post.

Next Steps

To learn how to install Maven and setup a new site see Part 2 -https://aemshack.com/install-aem-site/.