SAP Java Buildpack 2 is a Cloud Foundry buildpack for running SapMachine-based applications.
This buildpack supports Java 17, 21 and 25, as well as the following runtimes:
To use this buildpack, specify its name when deploying a Jakarta-based application to the SAP BTP, Cloud Foundry environment. You can do it the following ways:
-
Specify it directly in the
cf pushcommand:cf push -f <PATH_TO_APP_MANIFEST> -b sap_java_buildpack_jakarta -
Specify it in the
manifest.ymlfile of your application by using thebuildpacksattribute:--- applications: - name: <APP_NAME> memory: 512M buildpacks: - sap_java_buildpack_jakarta ... env: TARGET_RUNTIME: tomcatThen, you can deploy the application like this:
cf push <app_name> -
(MTA only) For multi-target applications, specify it in the
mtad.yamldeployment descriptor file by using thebuildpackattribute:... modules: - name: <APP_NAME> type: java.tomcat path: <path_to_archive> properties: ... parameters: ... memory: 512M buildpack: sap_java_buildpack_jakarta ...Then, you can deploy the application like this:
cf push <app_name>
The SAP BTP, Cloud Foundry environment provides four versions of SAP Java Buildpack 2 as part of its system buildpacks:
-
sap_java_buildpack_jakarta – Holds the latest available version of SAP Java Buildpack 2. All new features and fixes are provided with this version.
-
sap_java_buildpack_jakarta_<version_latest> – Holds the latest available version of SAP Java Buildpack 2. It's available for a limited timeframe (4 to 6 weeks).
-
sap_java_buildpack_jakarta_<version_previous> – This version used to be latest in the previous update of the SAP BTP, Cloud Foundry environment. It's available for a limited timeframe (4 to 6 weeks).
-
sap_java_buildpack_jakarta_<version_before_previous> – This version used to be latest before two updates of the SAP BTP, Cloud Foundry environment. It's available for a limited timeframe (4 to 6 weeks).
To check these versions, proceed as follows:
-
Log in to a particular SAP BTP region and subaccount. For example, if your region is eu10, run:
cf api https://api.cf.eu10.hana.ondemand.com -
Then run:
cf buildpacks
-
Option 1: Use the default one – sap_java_buildpack_jakarta
You take advantage of all latest features and fixes in SAP Java Buildpack 2. This way, it's guaranteed that the buildpack is always available. The drawback in this case is the limited time for adoption, if it's needed. In such a scenario, applications can fall back to an older version temporarily to avoid any downtime.
-
Option 2: Set a particular version – sap_java_buildpack_jakarta_<version_suffix>
Bear in mind that this version will only exist for a limited amount of time. This may lead to the situation where application restage is failing because the used version of the buildpack is no longer available. To avoid this, we recommend that you follow the updates of the buildpack and test your applications with its latest version. Developers should never allow their applications to run on an outdated buildpack version.
Example:
Let's say that the latest version of SAP Java Buildpack 2 is 2.38.0. Then, the output of the cf buildpacks command would be:
buildpack position enabled locked filename
sap_java_buildpack_jakarta 1 true false sap_java_buildpack_jakarta-v2.38.0.zip
sap_java_buildpack_jakarta_2_38 2 true false sap_java_buildpack_jakarta-v2.38.0.zip
sap_java_buildpack_jakarta_2_37 3 true false sap_java_buildpack_jakarta-v2.37.0.zip
sap_java_buildpack_jakarta_2_36 4 true false sap_java_buildpack_jakarta-v2.36.0.zip
When SAP Java Buildpack 2 is updated on the SAP BTP, Cloud Foundry environment from version 2.38.0 to 2.39.0, the list will change to:
buildpack position enabled locked filename
sap_java_buildpack_jakarta 1 true false sap_java_buildpack_jakarta-v2.39.0.zip
sap_java_buildpack_jakarta_2_39 2 true false sap_java_buildpack_jakarta-v2.39.0.zip
sap_java_buildpack_jakarta_2_38 3 true false sap_java_buildpack_jakarta-v2.38.0.zip
sap_java_buildpack_jakarta_2_37 4 true false sap_java_buildpack_jakarta-v2.37.0.zip
This means that sap_java_buildpack_jakarta_2_36 will no longer be available for applications.
No fixes will be provided to older versions of the buildpack. Fixes, including security ones, will be part of the latest version.
To use sap_java_buildpack_jakarta_<version_suffix>, specify its name when pushing an application to the SAP BTP, Cloud Foundry environment:
cf push -f <PATH_TO_APP_MANIFEST> -b sap_java_buildpack_jakarta_2_39
Alternatively, you can specify the buildpack in the manifest.yml file.
For example:
---
applications:
- name: myapp
memory: 128M
path: ./target/myapp.war
instances: 1
buildpacks:
- sap_java_buildpack_jakarta_2_39
You can do the same in the mtad.yml of your mtar archive:
...
modules:
- name: myapp
type: java.tomcat
path: ./target/myapp.war
properties:
...
parameters:
...
memory: 512M
buildpack: sap_java_buildpack_jakarta_2_39
...
SAP Java Buildpack 2 (sap_java_buildpack_jakarta) supports the following Java versions:
- Java 17 – you can obtain it by using SapMachine 17 (it provides a JRE with Java 17)
- Java 21 – default version. You can obtain it by using SapMachine 21 (it provides a JRE with Java 21)
- Java 25 – you can obtain it by using SapMachine 25 (it provides a JRE with Java 25)
To learn how to configure your application to use SapMachine JRE and JDK, see: SapMachine
SAP Java Buildpack 2 provides the following components in the application container (<APP_ROOT_DIR>/app/META-INF/.sap_java_buildpack):
-
SapMachine – version 17, 21, 25
-
SAP BTP Security Services Integration Libraries – version 3.x
To check all the components regularly updated in the SAP Java Buildpack 2.x releases, see: SAP Java Buildpack BOM
To see the latest news and updates about SAP Java Buildpack 2, regularly check the release notes on the What's New portal.
If you encounter an issue while using SAP Java Buildpack 2, you can:
-
Search for your problem in our Troubleshooting section.
-
Create an incident for your specific problem, using support component BC-CP-CF-BLDP. To provide the necessary details, use the following template: Initial Problem-Related Data