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: 
0 Kudos
In a typically project lifecycle the runtime system will be patched and/or updated continuously. From a developer perspective some overhead activities must fullfil before you can work with a new release, e.g. a new NWDS must be downloaded. There could be also other project or personally reasons like the following (to have different versions of NWDS installed):

  • your system will be upgraded to a new Netweaver release (like a Support Package Stack change from NW 7.40 to NW 7.50)

  • end of release for an old release (maybe NW 7.20) -> upgrade/switch is inescapable

  • you are in the development phase of a running project where you develop for a new release/next sprint and/or must support maintenance for an old release (including an aBPM scenario regeneration, etc.)

  • or you work in multiple project with different releases in parallel


But you want in the best case only installation of NWDS to support mostly the points from above.

In this blog I show some tricks and hints that helps inside NWDS 7.50 (needs Java8, actually the latest available Netwever release) to generate/bugfix source code for an older NW release (e.g. for Java6) with only one installation of NWDS.

Hint: The following content in only for the JEE layer/Java development. In case you need to develop stuff (like ESR content/mappings/iFlows) for the AEX layer you need a corresponding NWDS version to your runtime system. I try it with the latest version, but I have seen issues during activation/transport of AEX content like iFlows etc.

Now lets drive into more details:

1. General NWDS preferences

Before you can develop for multiple Java versions you need some basic configurations.

1. Start NWDS
2. Go to Window -> Preferences
3. Under Java -> Installed JREs add the JRE/JDK version/s that you need (In my case I have selected jdk1.6.0 to my default setting)



4. Under Development Infrastructure -> DC Build you can specify the default source and target compliance (In my case I have selected 1.6 to my default settings -> the seeting in relevant for new Dev. config. and/or new local software components)



5. Apply you changes and press OK

2. Developement infrastructure perspective

Inside development configuration it is necessary to check the JDK target settings for that you want to develop. This comes normally from NWDI and was configured by NWDI administrator. But in some cases for multiple tracks/existing dev. configs inside the same workspace or for you LocalDevelopment config it is better to check and switch these settings.

1. Open the Dev.Config
2. Check inside Component Properties the Technology-Specific settings for "JDK source and target compliance" (in my case 1.6 is selected, because my track must support Java6 development)
3. Optinally: Under the DropDown for "JDK for Local DC Build" you can specify the path to the JDK, e.g. if you have more than ones for Java6 or Java8.



 

3. Generate.xml settings to genrate Java6 compliant classes (necessary for aBPM generation)

Normally the NWDS uses the JDK of your ant build to generate Java classes. Most of the generated classes during the aBPM framework generation are compartible to previous Java versions, but to guarantee that the generated class files are Java6 compliant an additonal tag must be insert into the Generate.xml configuration.

1. Open the Generate.xml of your aBPM scenario
2. Add the following tag for the first child element under <target> tag (The tag define the target version of the java classes, the compiler version and the path to the JDK)
<javac srcdir="src" target="1.6" compiler="javac1.6" source="1.6" executable="C:/NWDS/jdk1.6.0_45/bin" fork="true" taskname="javac1.6"></javac>

3. Save the changes

At the end the Genrate.xml. should look like this:



 

4. Reconfigure Ant build setting (necessary for aBPM generation)

In case the NWDS configuration from above was done and the Generate.xml will be dragged and dropped into the Ant build view successfully the following error messages can be occured during execution/re-execution of the generate process:





The reason is that NWDS 7.50 is technically running with a virtual machine of JDK8. Inside of the Genrate.xml is defined a generation of Java6 compliant classes. And this configuration will be set for the default JRE setting of the Ant build configuration (hint: the Ant build/external program configuration can be shown in detail under the menu option "External tool configurations...")

Here exists an tab JRE and this option must be reconfigured to an JRE environment that is supported by the NWDS Ant build plug in. My recommendation to set the drop down to the JDK version that is used by the NWDS itself (in my case jdk1.8.0_121).

1. Open "External tool configurations..."
2. Switch to tab JRE
3. Change the drop down from jdk1.6.x to a supported version jdk1.7.y/jdk1.8.z (in my case from jdk1.6.0_45 to jdk1.8.0_121)
4. Apply the changes
5. Run the Ant build again



With these settings you can develop aBPM scenarios and JEE source code for multiple NW releases and different Java version in different projects with one installation of NWDS 7.50.