Quantcast
Channel: rtrouton – Der Flounder
Viewing all articles
Browse latest Browse all 764

Packaging SAP GUI for macOS with Java 11 support

$
0
0

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.

Screen Shot 2018 12 14 at 10 39 38 AM

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.

Screen Shot 2018 12 14 at 4 15 11 PM

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.

Screen Shot 2018 12 14 at 11 14 36 AM

Screen Shot 2018 12 14 at 11 14 59 AM

Installation is performed by uncompressing into the following directory on macOS:

/Library/Java/JavaVirtualMachines

Screen Shot 2018 12 14 at 4 11 14 PM

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.

Screen Shot 2018 12 14 at 2 46 13 PM

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:

  1. Detects if Java is installed
  2. Detects if JavaFX is installed
  3. If Java is not installed, install the latest release of SapMachine JDK.
  4. If JavaFX is not installed, install the latest release of OpenJFX.
  5. Verifies that both Java and JavaFX are installed.
  6. 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.

Screen Shot 2018 12 14 at 10 44 56 AM

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.

Screen Shot 2018 12 14 at 10 49 51 AM

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

1. Set up a new Packages project and select Raw Package.

Screen Shot 2018 12 14 at 3 41 10 PM

2. In this case, I’m naming the project SAP GUI 7.50 rev5.

Screen Shot 2018 12 14 at 3 41 26 PM

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.)

Screen Shot 2018 12 14 at 3 41 52 PM

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

Screen Shot 2018 12 14 at 3 42 43 PM

7. Select the Payload tab. Nothing here should be changed from the defaults.

Screen Shot 2018 12 14 at 3 43 12 PM

8. Select the Scripts tab.

Under the Additional Resources section, add the following files:

If you have a templates.jar file, also add that file.

Screen Shot 2018 12 14 at 2 08 30 PM

Screen Shot 2018 12 14 at 3 54 40 PM

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.

Screen Shot 2018 12 14 at 3 55 57 PM

Screen Shot 2018 12 14 at 4 24 32 PM

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.

Screen Shot 2018 12 14 at 3 56 11 PM

Screen Shot 2018 12 14 at 3 56 23 PM

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.)

Screen Shot 2018 12 14 at 4 00 00 PM

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.

Viewing all articles
Browse latest Browse all 764

Trending Articles