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
Q&A
Please use this thread to ask the related questions.
Kautuk Sahni