This tutorial will guide you through getting your SAP Cloud SDK development environment up and running on Linux. All the steps were verified on Ubuntu 18.04 and should be in compliance with other Debian based distributions.
No initial knowledge is required.
SAP Cloud SDK supports Java 8 and Java 11
I'll base this example on Java 8
Updating alternatives to make sure right version of Java is used
Your distribution might have a different version of Java installed by default. You can check you Java version by running:
As you can see bellow, my laptop has Java 11 as default.
Check what Java versions you have on you machine with:
After installing OpenJDK 8 you should now have both Java 8 and Java 11
To switch between Java versions run:
In my case I have to press 2 to make Java 8 default
Check Java version again. Mind,
version parameter has just one hyphen for Java 8 CLI
You have now switched to Java 8
Install maven with:
To check if
maven is installed correctly run:
You'll see the maven version and build details
To find out more about Apache Maven, how to get it for your Linux distribution and detailed tutorials follow the official maven documentation.
To deploy your App developed with SAP Cloud SDK to SAP Cloud Platform you'll need Cloud Foundry CLI. You can download latest release of DEB package from official CF GitHub repository or follow instructions to install it with you package manager: apt-get, yum and homebrew are supported.
After installing the CLI you might need to reload you shell before it becomes available. To check if it works run:
For best developer experience we recommend getting community version of IntelliJ Idea. Download gzip archive from the official site and follow installation instructions for you system.
Another supported IDE is Eclipse.
The snippet above will create a Tomee App, you can also use archetype for Spring Boot.
Change directory to the root of the App you've just created
To build your APP run
After a successful build you'll find a
target folder within you App's root folder containing a
along with other build artifacts. This
war file is a packaged version of your web-app that's going to be deployed to the
SAP Cloud Foundry environment.
Let's associate you Cloud Foundry (CF) CLI to your SAP account by providing an API endpoint and logging in with your account.
Select endpoint depending on your region:
- Europe https://api.cf.eu10.hana.ondemand.com
- US East: https://api.cf.us10.hana.ondemand.com
- US CENTRAL: https://api.cf.us20.hana.ondemand.com
To use a snippet for Europe run:
Provide your credential for SAP Cloud Foundry by running:
To deploy your app run:
After a successful deployment you'll see a status of just pushed App:
To verify your deployment take a
URL indicated in
routes section from deployment output above. Put it into your
browser and add
/hello at the end. It should look similar to: