on 2025 Apr 08 3:30 PM
Hello Friends,
My issue is while trying to upgrade the java build pack from sap_java_buildpack to sap_java_buildpack_jakarta, we are also upgrading our JDK version to 21.
So i changed buildpack specified in manifest.yml file to sap_java_buildpack_jakarta
And changed in buildpack specified in mta.yaml file to sap_java_buildpack_jakarta
After compiling my code with Java 21, I deployed a simple HelloWorld servlet to Cloud Foundry. However, upon executing the endpoint, I received a "not found" error. I subsequently reviewed the subaccount-level logs for further insights.
"xxxx/Test has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0 (unable to load class [xxxx.test.Test])","stacktrace":["java.lang.UnsupportedClassVersionError: xxxx/test/Test has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0 (unable to load class [xxxx.test.Test])"
It clearly giving JRE will accept only version 17 only, but my organization has asked to upgrade to Java 21.
I referred this sap help document for upgrading Java to 21
https://help.sap.com/docs/btp/sap-business-technology-platform/sapmachine
SAP mentioned to add below environment variables into manifest.yaml file
if I add and deploy also its giving same error
This my pom.xml file
Request clarification before answering.
Hi friends,
I found out the solution,
We have to specify this two below env variables under the
properties tag in the mta.yaml file
properties:
JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jre.SAPMachineJRE']"
JBP_CONFIG_SAP_MACHINE_JRE: '{ version: 21.+ }'
This is working fine
Best Regards,
Mohanraj V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
25 | |
22 | |
8 | |
8 | |
7 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.