Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Szabolcs_Renyo
Advisor
Advisor

Disassembling the puzzle


 

Recently I realized that we receive more and more incidents where even despite very good product documentation, the problem is at the end with improperly configured JDK settings. In order to help our customers I thought it’s time to write a holistic blog post explaining how to configure NWDI that supports development for multiple track releases (which determines the JDK versions at the same time).

 

Follow this guide how to configure NWDI to use different JDKs per Track.

There are three major settings to be configured:




  • A Build Variant com.sap.jdk.home_path_key configurable per Track (in NWDI)

  • Two CBS Service properties (in NWA):

    • BUILD_TOOL_JDK_HOME

    • JDK_HOME_PATHS




For now, without going into any details, on the below abstract figure, you can see the relationship of these settings:





  • BUILD_TOOL_JDK_HOME has to point to the highest available JDK

  • JDK_HOME_PATHS defines key-value pairs where the key is typically something like JDK<version>_HOME and the corresponding value is the path where the JDK is actually installed on the server.

  • The key default is optional

    • If the default key is set, then it is taken into consideration only, in case no Build Variant has been defined



  • The build will fail if

    • No matching JDK_HOME_PATHS key available

    • Build Variant mistyped




 

 

On the halfway completing the puzzle


 

Now let’s take a look at the same figure with less abstract data but still without any exact configuration details (how to do this in NWA, etc)



In this example we plan to develop for the following releases:




  • In TRACK_1 for 7.50

  • In TRACK_2 for 7.02

  • In TRACK_3 for 7.30

  • In TRACK_N for 7.20


Set the Build Variants in CMS this way:




  • For TRACK_1 specify Build Variant com.sap.jdk.home_path_key = JDK1.8.0_HOME

  • For TRACK_2 specify Build Variant com.sap.jdk.home_path_key = JDK1.4.2_HOME

  • Do not specify Build Variant for TRACK_3

  • For TRACK_N specify Build Variant com.sap.jdk.home_path_key = JDK1.5.0_HOME


 

Set the CBS settings in NWA this way:

  • BUILD_TOOL_JDK_HOME = C:\Java\java8

  • JDK_HOME_PATHS = JDK1.8.0_HOME=C:\Java\JDK1.8; JDK1.4.2_HOME=C:\Java\JDK1.4.2; default=C:\Java\JDK1.6


As a result:




  • TRACK_1 is going to use JDK1.8

  • TRACK_2 is going to use JDK1.4

  • TRACK_3 is going to use JDK1.6 because no Build Variant defined

  • TRACK_N build is going to fail because there is no key-value pair JDK1.5.0_HOME available in CBS Settings


Benefit using default

Another benefit of using default is if there are many tracks and the majority of them is using the same Build Variant.


Example1:


If you have 10 Tracks out of which 9 are using JDK1.6 and only 1 Track is using JDK1.8 then specify a build variant “com.sap.jdk.home_path_key” only for that Track that is using JDK1.8 and setup CBS settings as follows (and do not specify Build Variant for the other 9 Tracks):


BUILD_TOOL_JDK_HOME = C:\Java\java8
JDK_HOME_PATHS = JDK1.8.0_HOME = C:\Java\JDK1.8; default= C:\Java\JDK1.6


Use the below table to decide which build variants to use for which release:


Track 71X uses JDK1.5

Track 720 uses JDK1.5

Track 73X uses JDK1.6

Track 740 uses JDK1.6

Track 750 uses JDK1.8

 


The last puzzle pieces (where to do the configuration)


After understanding the theory now let’s see where to do the actual configuration in NWA and NWDI




Required configuration in NWDI (CMS)

The Build Variant of the track can be set in http://<host>:<port>/devinf  --> “Change Management Service (CMS)” --> “Landscape Configurator” --> Select your track --> ”Track Data” --> ”Build Variants”


 In case if you use CM Services instead of CMS the Build Variant can be set in http://<host>:<port>/devinf --> "CM Services" --> Select your System --> click on tab "Software Component Definition" --> Select your SC --> expand the "Build options for software component".




Required configuration in NWA

 

In the CBS Service settings (http://<host>:<port>/nwa/sys-config -> select the tab "Services" --> look up "Component Build Service").

Notice that these settings are relevant only for 7.1+.


7.0x or below: check these settings in Visual Administrator's service "Component Build Service".


 

  • Filter for the property BUILD_TOOL_JDK_HOME and set its value to the path of the highest available JDK version (the bin folder where the executable “javac” is located).

  • For JDK_HOME_PATHS define key=value pairs separated by semicolon (“;”).


 

Hint: filter for the word “home” in order to display both of the parameters as seen below:





What if my settings are wrong?

If the discussed settings are not correct then you might face the following possible problems:




  • Unsupported major.minor (above discussed wrongly set up JDK versions can lead to the case where a classfile built with a higher JDK cannot be executed by a JVM expects lower classfile version)

  • Build request are stucking in the queue

  • Activation (or direct DC build) fails. This case the Request log displays errors and no Build log available.


E.g. Error! The following error occurred during request processing: Could not find valid JDK home path value for key <your invalid key> to start build controller



12 Comments