Java 11 code is failing in cloud manager build

Last update: 2023-10-02

Description

Environment

AEM Cloud Service

Issue/Symptoms

The code related to java version => 11 is failing 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

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.

On this page