Ubuntu: How to install SapMachine, Eclipse with ADT, abapGit, and SAP GUI for Java

One development tool for SAP ABAP developers is Eclipse with plugins like the ABAP Development Tools (ADT) and the belonging abapGit. This blog post gives an overview how you set your ABAP development environment up on Ubuntu 20.04 to connect to SAP On-premise and/or Cloud Platform.

Eclipse with ADT and abapGit on Ubuntu
Eclipse with ADT and abapGit on Ubuntu

SapMachine 11 for Eclipse

If you want to use Eclipse 2020-09 or higher, you will need to install Java 11. [1] But SAP recommends using the SapMachine 11 that is a “friendly fork” of open source Java. [2] So, the first step is to install the SapMachine on Ubuntu:

# https://github.com/SAP/SapMachine/wiki/Installation
sudo bash

apt-get install -y --no-install-recommends wget ca-certificates gnupg2

export GNUPGHOME="$(mktemp -d)"
wget -q -O - https://dist.sapmachine.io/debian/sapmachine.old.key | gpg --batch --import
gpg --batch --export --armor 'DA4C 00C1 BDB1 3763 8608 4E20 C7EB 4578 740A EEA2' > /etc/apt/trusted.gpg.d/sapmachine.old.gpg.asc
wget -q -O - https://dist.sapmachine.io/debian/sapmachine.key | gpg --batch --import
gpg --batch --export --armor 'CACB 9FE0 9150 307D 1D22 D829 6275 4C3B 3ABC FE23' > /etc/apt/trusted.gpg.d/sapmachine.gpg.asc
gpgconf --kill all && rm -rf "$GNUPGHOME"
echo "deb http://dist.sapmachine.io/debian/amd64/ ./" > /etc/apt/sources.list.d/sapmachine.list

apt-get update
apt-get install sapmachine-11-jdk

You can check the result with the command “java -version“.

SapMachine 11: Check the installation
SapMachine 11: Check the installation

Eclipse IDE for Java Developers

Next, download the Eclipse Installer (e.g. Eclipse-2020-12) [3] and extract the tar.gz-file [4]:

# https://man7.org/linux/man-pages/man1/tar.1.html
# z: (un)z̲ip.
# x: ex̲tract files
# v: print filenames verbosely
# f: file(name)

tar -zxvf eclipse-inst-jre-linux64.tar.gz 

Then, start the Eclipse Installer with the command

# Open the folder "eclipse-installer"


and choose “Eclipse IDE for Java Developers” and ensure that you will use the SapMachine under “Java 11 + VM“.

Eclipse Installer: Use SapMachine
Eclipse Installer: Use SapMachine

Add ABAP Development Tools (ADT) and abapGit

Now, add the ADT to Eclipse: [5]

  • Open Eclipse
  • Choose “Help > Install New Software” in the menu
  • Add the URL “https://tools.hana.ondemand.com/latest” and select “ABAP Development Tools“.
  • Press twice “Next“, confirm the license agreements, and press “Finish”.

If the installation is completed, Eclipse needs to be restarted. After that, add apabGit to Eclipse by repeating the previous steps and using the URL “https://eclipse.abapgit.org/updatesite/“. [6]

Install the SAP GUI for Java

If you want to connect to an ABAP backend system (in Eclipse “New > ABAP project), you will need to install the SAP GUI for Java, e.g. SAP GUI for Java 7.50 rev 12 from 30.11.2020.

Download the SAP GUI for Java with the Download Manager [7] and start the SAP Installer and follow the wizard steps:

# Start the SAP Installer

java -jar PlatinGUI750_12-80002496.JAR
SAP GUI for Java: Installation
SAP GUI for Java: Installation
SAP GUI for Java: Module Path
SAP GUI for Java: Module Path

Create an SAP connection string

Now, start the SAP GUI and create a new connection. Switch to the tab “Advanced” at the connection properties and select “Expert Mode”.

SAP GUI for Java: Connection String
SAP GUI for Java: Connection String

The connection string has the following structure: [8]

# Application Server:
# Instance number: 01
# Client: 800
# User: demo_user
# Language: EN

conn=/H/<Application Server>/S/32<instance number>&clnt=<client number>&user=<user name>&lang=<language>

Create an ABAP project in Eclipse

You will need those connections when you want to connect to a backend server in Eclipse. Create a new ABAP project (“File > New ABAP project“) and a popup opens that displays all SAP connections. Choose a connection and follow the wizard steps.

Eclipse: Add ABAP project
Eclipse: Add ABAP project

You will find further information and tutorials how to create a ABAP cloud project, how to use ADT shortcuts, [9] or how to develop a Fiori App with RAP (RESTful Application Programming Model) under https://developers.sap.com/.

Get JavaFX and copy it into the SapMachine folder

But when you try to create a Dictionary Object in Eclipse like a table you will run into the following error: “Your Java Virtual Machine seems not to support JavaFX”.

Java Virtual Machine does not support JavaFX
Java Virtual Machine does not support JavaFX

You will need JavaFX so that Eclipse is able to access the SAP GUI.

Eclipse interacts with the SAP GUI
Eclipse interacts with the SAP GUI

The error is easy to fix. First, download JavaFX (JavaFX Linux SDK). [10] Second, unzip the file into the download directory. Third, copy the files of the folder “lib” into the “lib” folder of your Java Virtual Machine (e.g. SapMachine).

# 1. Unzip 
unzip ~/Downloads/openjfx-11.0.2_linux-x64_bin-sdk.zip -d ~/Downloads/

# 2. Copy all files of lib-folder into jvm's lib-folder
sudo cp ~/Downloads/javafx-sdk-11.0.2/lib/* /usr/lib/jvm/sapmachine-11/lib/

This should fix the issue, and you can test it by creating a table in Eclipse.

Further information:
[1] 2949356 – Java 11 is mandatory for ADT in February 2021
[2] SAP builds its own Java distribution, SapMachine on GitHub
[3] Eclipse Installer
[4] tar on Linux manual page
[5] https://tools.hana.ondemand.com/#abap, Create an ABAP Project in ABAP Development Tools (ADT)
[6] https://github.com/abapGit/abapGit
[7] SAP ONE Support Launchpad
[8] SAP GUI For Java Connection Strings
[9] Useful Keyboard Shortcuts for ABAP in Eclipse
[10] https://openjfx.io/
How to set default Java version on Ubuntu / Debian

Leave a Reply