Unable to use managed-app-utility.jar from MAM-SDK with Java 11
book
Article ID: CTX463824
calendar_today
Updated On:
Description
Building a custom app using Java 11 or later, the gradle build chain fails when invoking the final stage "task generateMdx" as the jar file for this stage requires Java 1.7/1.8 (Java/JDK 8)
Resolution
When you are building a custom APK and are relying on libraries which requre Java 11 or newer, you need to use a computer which has both Java 11 (or later) and Java 1.8 installed in different paths. The screenshots below were taken on a Windows 10 computer, but equivalent steps can be taken on macOS.
Set your java path to the location of the Java 11 JDK
At the command prompt, build your project (commandline: gradlew clean build)
The build will proceed to the final step, where it will fail with an error that generateMDX requires Java 1.8/1.8
However, you can observe that the APK file was created correctly.
Update your Java path to point to the location where you have Java 1.8 installed
At the command prompt, invoke the managed-app-utility.jar directly
The .mdx wrapped output should be produced.
Problem Cause
The current release of managed-app-utility.jar only supports Java 1.7 / Java 1.8 Oracle currently support Java 11 LTS and Java 17 LTS versions.
Issue/Introduction
When building MAM-SDK apps using Java 11 or newer, the final step in the build process fails as the jar to produce the .mdx file requires Java 1.8; A work-around is described where both Java 11 and Java 1.8 are used side by side.