SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Create an Application with SAP Java Buildpack 2

Create a simple Spring Boot application and enable services for it, by using SAP Java Buildpack 2 and Cloud Foundry Command Line Interface (cf CLI).

Overview

🎓 beginner 45 min. JavaBeginnerSAP BTP Cloud Foundry EnvironmentSAP BTP Cockpit

You will learn

  • โœ”How to create a Spring Boot Java project
  • โœ”How to create and deploy a simple “Hello World” application
  • โœ”How to run authentication and authorization checks via the Authorization and Trust Management (XSUAA) service
Gergana Coffman G Gergana Coffman June 4, 2026
Created by July 14, 2023
Contributors

Prerequisites

Prerequisites

Steps

Intro

This tutorial will guide you through creating and setting up a simple Java application by using cf CLI. You will start by creating a Java project via Spring Boot, and then creating a web application that returns simple data โ€“ a Hello World! message. This simple app will be invoked through a web microservice (application router). Finally, you will set authentication checks and an authorization role to properly access your web application.


Step 1 Log on to SAP BTP
โ€”

First, you need to connect to the SAP BTP, Cloud Foundry environment with your trial or enterprise (productive) subaccount. Your Cloud Foundry URL depends on the region where the API endpoint belongs to. To find out which one is yours, see: [Regions and API Endpoints Available for the CF Environment] (https://help.sap.com/docs/btp/sap-business-technology-platform/regions-and-api-endpoints-available-for-cloud-foundry-environment)

In this tutorial, we use eu20 as an example.

  1. Open a command-line console.

  2. Set the Cloud Foundry API endpoint for your subaccount. Run the following command (using your actual region URL):

    Bash/Shell
    cf api https://api.cf.eu20.hana.ondemand.com
  3. Log on to the SAP BTP, Cloud Foundry environment:

    Bash/Shell
    cf login
  4. When prompted, enter your user credentials. These are the email and password you have used to register your trial or productive SAP BTP account.

    IMPORTANT: If the authentication fails, even though you’ve entered correct credentials, try [logging in via single sign-on] (https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/e1009b4aa486462a8951c4d499ce6d4c.html?version=Cloud).

  5. Choose the org name and space where you want to create your application.

    If you’re using a trial account, you don’t need to choose anything. You can use only one org name, and your default space is dev.

RESULT

Details about your personal SAP BTP subaccount are displayed (API endpoint, user, organization, space).

Step 2 Create a Java Project
+
Step 3 Complete your Java Project
+
Step 4 Deploy your Java application
+
Step 5 Run an Authentication Check
+
Step 6 Run an Authorization Check
+
Step 7 Assigning Roles to a User in SAP BTP Cockpit
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 7
1. Log on to SAP BTP 2. Create a Java Project 3. Complete your Java Project 4. Deploy your Java application 5. Run an Authentication Check 6. Run an Authorization Check 7. Assigning Roles to a User in SAP BTP Cockpit

Learn more →