AEM as a Cloud Service & Java 11 Pipelines | AEM Community Blog Seeding | Community
Skip to main content
kautuk_sahni
Community Manager
Community Manager
December 1, 2021

AEM as a Cloud Service & Java 11 Pipelines | AEM Community Blog Seeding

  • December 1, 2021
  • 2 replies
  • 2064 views

BlogImage.jpg

AEM as a Cloud Service & Java 11 Pipelines by The AEM Maven - Juan Ayala

Abstract

Recently I started a new AEM as a Cloud Service project. The first thing I did was generate a new repository using the Maven archetype. I assumed it would be using Java 11 from the get-go. I came to learn it did not! Here are 3 things you'll need to get your AEMaaCS project ready for Java 11.


Update the Project to Use Java 11

As soon as I started to write Java code IntelliJ began screaming at my var. I love the var keyword in Java. The type inference speeds things up a lot. We need to update the root POM file. Set the Java version to 11 on the maven-enforcer-plugin and maven-compiler-plugin plugins.



org.apache.maven.plugins
maven-enforcer-plugin


...


...

Maven must be executed with a Java 11 JRE or higher.
11







org.apache.maven.plugins
maven-compiler-plugin

11
11



Your IDE should pick up on the POM changes and switch the project to Java 11. That was easy! On to the next step.


Make Sure Maven Is Using Java 11

Once I was done making my changes I opened up a terminal and tried to run mvn clean install -P autoInstallSinglePlackage to get everything deployed. The enforcer I had configured denied me. I ran mvn --version and sure enough, Maven was using Java 8.

Read Full Blog

AEM as a Cloud Service & Java 11 Pipelines

Q&A

Please use this thread to ask the related questions.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Anmol_Bhardwaj
Community Advisor
Community Advisor
December 1, 2021

Just moved to AEM as a Cloud, will keep this in mind while migration.

VeenaVikraman
Community Advisor
Community Advisor
July 4, 2024

Recently , my build was failing with the same error

Maven must be executed with a Java 11 JRE or higher 

This blog https://www.theaemmaven.com/post/aem-as-a-cloud-service-java-11-pipelines was useful in understnading the issue. To know how to create the file refer https://www.tothenew.com/blog/resolving-adobes-cloud-manager-deployment-issue-with-java-version-compatibility/