Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Maven Compile Error on AEMaaCS 2023.07

Avatar

Community Advisor

Hi AEM Community,

 

I have the below error which comes when deploying a pipeline to the DEV environment (version 2023.07)

The error logged is shown below - 

 

13:19:31,997 [main] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project eqx-aem-dam.core: Compilation failure
13:19:31,997 [main] [ERROR] /build_root/build/project-dam/core/src/main/java/com/eqx/aem/dam/core/servlet/CustomServlet.java:[3,47] cannot access org.apache.jackrabbit.api.security.user.Group
13:19:31,999 [main] [ERROR] bad class file: /root/.m2/repository/com/adobe/aem/aem-sdk-api/2023.5.11983.20230511T173830Z-230200/aem-sdk-api-2023.5.11983.20230511T173830Z-230200.jar(org/apache/jackrabbit/api/security/user/Group.class)
13:19:32,000 [main] [ERROR] class file has wrong version 55.0, should be 52.0
13:19:32,001 [main] [ERROR] Please remove ormake sure it appears in the correct subdirectory of the classpath.
13:19:32,002 [main] [ERROR] -> [Help 1]

 

The file CustomServlet.java has the below import statement - 

import org.apache.jackrabbit.api.security.user.Group;

Is there any known fix for this issue?

 

Thanks,

Rohan Garg

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi All,

 

I was referring to a similar thread on AEM Cloud Manager Build Error Bad Class File

Version 52.0 is Java 8 and version 55.0 is Java 11.

Cloud Manager, by default, compiles via Java8. 
However, some classes in the aem-sdk-api are compiled with Java11. 
This is why this error manifests itself.

As per Build Environment Configuration -

By default, projects are built by the Cloud Manager build process using the Oracle 8 JDK. Customers wishing to use an alternate JDK have two options.

I will update the JDK version to 11 and let know the results.

 

Update - 

Pointing JDK to version 11 did the trick!

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi All,

 

I was referring to a similar thread on AEM Cloud Manager Build Error Bad Class File

Version 52.0 is Java 8 and version 55.0 is Java 11.

Cloud Manager, by default, compiles via Java8. 
However, some classes in the aem-sdk-api are compiled with Java11. 
This is why this error manifests itself.

As per Build Environment Configuration -

By default, projects are built by the Cloud Manager build process using the Oracle 8 JDK. Customers wishing to use an alternate JDK have two options.

I will update the JDK version to 11 and let know the results.

 

Update - 

Pointing JDK to version 11 did the trick!

Avatar

Level 2

Hi Rohan,

 

Java JDK 11 should work as it is supported by AEM CaaS [See here] . However Java version 8 is also supported. We need to make sure that either our project is compiled and built using Java8 or Java11 and make sure suggest same in core POM and bundle POM files. 

 

The error seems to suggest that you need to downgrade jackrabbit maven package from v55 to v52. Just FYI, cloud manager can also compile project code using Java v11, it is just that required Java version should be 1.8.0 (v8) or higher for maven to be executed

 

 

Avatar

Community Advisor

@bagwanpankaj  - Thanks for your reply!

Yes, changing the JDK version worked. The default version of Java 8 had to be upgraded to Java 11.