Java 11 code fails in cloud manager build

To resolve the issue, update the Maven project configuration to use Java 11.

Description description

Environment

Adobe Experience Manager as a Cloud Service (AEMaaCS)

Issue

The code related to java version => 11 fails in the build process via the cloud manager.

Examples of Java error messages that you may observe:

Example 1:

package java.net.http does not exist

Example 2:

Initialize a static Map using Java 9 Map.of()

error:
symbol: method of(java.lang.String,java.lang.String)
location: interface java.util.Map

Resolution resolution

To resolve the issue, update the Maven project configuration to use Java 11.

Cause

By default, projects are built by the Cloud Manager build process using the Oracle 8 JDK.

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f