New AEM cloud project. Should I be using Java 11 or Java 8 to compile my project? | Community
Skip to main content
May 28, 2021
Solved

New AEM cloud project. Should I be using Java 11 or Java 8 to compile my project?

  • May 28, 2021
  • 1 reply
  • 1559 views

Simple question. I want to be able to use the updated interfaces and new features offered in Java 11. AEM documentation says it supports java 11. Can I use it to compile the code? Will it work fine with Cloud Manager? 

 

Please advice. Thanks

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

Hi @hades0202 

 

Cloud Manager now supports building projects with both Java 8 and Java 11. By default, projects are built using Java 8.
Customers who want to use Java 11 in their projects can do so using the Apache Maven Toolchains Plugin by adding the below <plugin> entry in the pom.xml

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
<configuration>
<toolchains>
<jdk>
<version>11</version>
<vendor>oracle</vendor>
</jdk>
</toolchains>
</configuration>
</plugin>

Please see the article from Adobe:

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/onboarding/getting-access/create-application-project/build-environment-details.html?lang=en

 

Hope this helps!

Thanks

1 reply

Asutosh_Jena_
Community Advisor
Asutosh_Jena_Community AdvisorAccepted solution
Community Advisor
May 29, 2021

Hi @hades0202 

 

Cloud Manager now supports building projects with both Java 8 and Java 11. By default, projects are built using Java 8.
Customers who want to use Java 11 in their projects can do so using the Apache Maven Toolchains Plugin by adding the below <plugin> entry in the pom.xml

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
<configuration>
<toolchains>
<jdk>
<version>11</version>
<vendor>oracle</vendor>
</jdk>
</toolchains>
</configuration>
</plugin>

Please see the article from Adobe:

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/onboarding/getting-access/create-application-project/build-environment-details.html?lang=en

 

Hope this helps!

Thanks

hades0202Author
May 29, 2021
Hello, thanks for replying. Yes, I think this help. Are you aware of any know issues when using java 11 in AEM?