A while back, I wrote a post on building a SAP GUI installer for macOS, where SAP GUI needed to have Oracle’s Java 8 JDK as a pre-requisite. Since then Oracle has made an announcement that the use of Oracle’s Java 11 JDK is no longer free if you’re using it for production work.
One of the consequences of that decision by Oracle is that SAP GUI 7.50 rev 5 is the first version of SAP GUI to support Java 11. However, the SAP GUI developers are now recommending the use of OpenJDK 11 in place of Oracle’s Java JDK 11. More specifically, the SAP GUI folks are recommending the use of SAP’s own SapMachine Java JDK 11 release.
Meanwhile, a Java library named JavaFX used by SAP GUI is no longer being bundled as part of Java 11. Instead, JavaFX has been split off into its own open source project called OpenJFX and is now a separate install.
What do SapMachine JDK 11 and JavaFX have in common? Among other things, neither have a native installer for macOS. Instead, each is distributed via compressed files.
Installation is performed by uncompressing into the following directory on macOS:
/Library/Java/JavaVirtualMachines
That said, SAP GUI also still works with Oracle’s Java JDK 8 as of the release of SAP GUI 7.50 rev 5. JavaFX is bundled with Java JDK 8, so installing Oracle’s Java JDK 8 handles both the Java and JavaFX requirements.
With all the changes, how should SAP GUI now be packaged for installation? Without question, the main challenge for deployment here is going to be the Java component. In my testing, which was limited to “Launch SAP GUI and see if it runs”, I found SAP GUI 7.50 rev 5 is able to run on the following Java releases:
If using any Java 11 release, OpenJFX will need to be installed for SAP GUI to successfully run.
With this in mind, it’s possible to build a package that does the following:
- Detects if Java is installed
- Detects if JavaFX is installed
- If Java is not installed, install the latest release of SapMachine JDK.
- If JavaFX is not installed, install the latest release of OpenJFX.
- Verifies that both Java and JavaFX are installed.
- If both Java and JavaFX are installed, install SAP GUI
For more details, please see below the jump.
For information on how to get and configure the SAP GUI installer, please see my earlier post on the topic as these details have not changed.
Downloading SapMachine Java 11 JDK
As of SAP GUI 7.50 rev 5, SAP GUI supports Java 11, with the preferred Java 11 release being the latest SapMachine OpenJDK 11 release. SapMachine is maintained and supported by SAP, so it is the OpenJDK 11 release best supported by SAP for SAP GUI.
To get the latest SapMachine OpenJDK 11 release, use the link below:
https://github.com/sap/SapMachine/releases/latest
Download the sapmachine-jdk-version_number_here_osx-x64_bin.tar.gz file.
Downloading JavaFX
As of Java 11, the JavaFX libraries used by SAP GUI are no longer bundled as part of the Java JDK. Instead, they must be downloaded and installed separately.
To get the latest OpenJFX release, use the link below:
https://gluonhq.com/products/javafx/
Download the JavaFX Mac OS X SDK .zip file.
Building the SAP GUI installer
The SAP GUI installer can perform the following tasks:
- Installing the latest Java on an as-needed basis
- Installing the latest JavaFX on an as-needed basis
- Installing the SAP GUI software
- Installing the SAP GUI connection and settings files
Pre-requisites
- Packages
- The latest SapMachine Java 11 JDK release
- The latest OpenJFX Java release
- SAP GUI for Java installer
- templates.jar file (optional)
1. Set up a new Packages project and select Raw Package.
2. In this case, I’m naming the project SAP GUI 7.50 rev5.
3. Once the Packages project opens, click on the Project tab. You’ll want to make sure that the your information is correctly set here (if you don’t know what to put in, check the Help menu for the Packages User Guide. The information you need is in Chapter 4 – Configuring a project.)
In this example, I’m not changing any of the options from what is set by default.
4. Next, click on the Settings tab. In the case of my project, I want to install with root privileges and not require a logout, restart or shutdown.
To accomplish this, I’m choosing the following options in the Settings section:
In the Tag section:
Identifier: set as appropriate (for my installer, I’m using com.sap.pkg.SAPGUI750rev5 )
Version: set as appropriate (for my installer, I’m usings 7.50.05 )
In the Post-installation Behavior section:
On Success: should be set to Do Nothing
In the Options section:
Require admin password for installation should be checked
Relocatable should be unchecked
Overwrite directory permissions should be unchecked
Follow symbolic links should be unchecked
7. Select the Payload tab. Nothing here should be changed from the defaults.
8. Select the Scripts tab.
Under the Additional Resources section, add the following files:
- The latest SapMachine Java 11 JDK release
- The latest OpenJFX Java release
- The latest SAP GUI for Java installer (this is the PlatinGUI .jar file)
If you have a templates.jar file, also add that file.
The last part is telling the SAP GUI for Java installer to run. For this, you’ll need a preinstall script and postinstall script.
Here’s the preinstall script being used for this installer package:
If not already selected, select the preinstall script and add it to the project.
Here’s the postinstall script being used for this installer package:
If not already selected, select the postinstall script and add it to the project.
9. Build the package. (If you don’t know to build, check the Help menu for the Packages User Guide. The information you need is in Chapter 3 – Creating a raw package project and Chapter 10 – Building a project.)
Testing the installer
Once the package has been built, test it by installing it on a test machine which has the following:
- Does not have the SAP GUI client installed
The end result should be that the SAP GUI client installs into /Applications. If a templates.jar was included with the installer, the SAP GUI configuration specified by the templates.jar file should also be installed.
Depending on whether Java is installed on this test machine or not, the following actions should take place:
- If Java 8 JDK is installed on the test Mac, neither SapMachine JDK 11 or JavaFX should be installed by the SAP GUI installer.
- If Java 11 JDK and Open JavaFX are installed, neither SapMachine JDK 11 or JavaFX should be installed by the SAP GUI installer.
- If Java 11 JDK is installed, only Open JavaFX should be installed by the SAP GUI installer.
- If Java is not installed, both SapMachine JDK 11 and Open JavaFX should be installed by the SAP GUI installer.