Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Running AEM 6.5 with JDK 11? | AEM Community Blog Seeding

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,159 likes

Total Posts

6,260 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,159 likes

Total Posts

6,260 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

31-05-2021

BlogImage.jpg

Running AEM 6.5 with JDK 11? by Asutosh Jena

Abstract

While running AEM 6.5 with Java 11 we ran into several issues especially with environment stability. This post outlines some of the items we all need to be aware of and address when using Java 11 with AEM 6.5

The Java Common Annotations module was removed from Java 11, so you need to add javax.annotation-api as a dependency.


javax.annotation

javax.annotation-api

1.3.2

provided



If you are seeing blank pages after deploying or bundle install on AEM it’s possible it’s happening due to https://issues.apache.org/jira/browse/FELIX-6184
You can resolve this by editing to /crx-quickstart/conf/sling.properties and update

sling.bootdelegation.sun=sun.*,com.sun.*,jdk.internal.reflect,jdk.internal.reflect.*

Since Java 9 Modules to make reflection work you need to allow it explicitly with --add-opens JVM option. Without it you may get errors like following:
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make ClassLoader.defineClass accessible: module java.base does not "opens java.lang" to unnamed module

You can address this by adding some of the commonly accessed packages by adding following to your AEM start script’s JVM options:

--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

Read Full Blog

Running AEM 6.5 with JDK 11?

Q&A

Please use this thread to ask the related questions.

AEM AEMEBlogSeeding Experience Manager