If you have tried to install the NWDS 7.1 Preview from SDN, you may have noticed that the installer checks the JDK version the NWDS shall be running on. JDK 1.4.x is too low, as the installer declares immediately:
As a SAP/Java developer being used to work with such an old JDK, you might be happy realizing this and you could be tempted to install the latest JDK (at the time of writing, JDK 6 Update 2) – saying to yourself, that this might be the first chance to work with the latest Java technology within the SAP universe.
Bad luck! Now the installer declares that on the one hand it needs a JDK version 1.5.0_06 or above, but – at the same time no JDK 1.6 or above is allowed:
Some folks might give up at this point and install the next (third) JDK (1.5.0_12 for example) on their computer. But – halt!
Beneath the possibility to install a JDK 1.5 and later to change the JDK path used by NWDS, you even can install the NWDS with a JDK 6 target – and with that, no need to install any JDK 1.5! It goes without saying that SAP won’t support such an installation, nevertheless, at a first glance, it simply runs! And the Java 6 Runtime has several performance improvements…
In the end, the trick is extremely simple, but the way to find out is not. But I don’t want to keep back this info, so here is the way how to find out:
If you have downloaded and extracted the RAR file, you will find the IDEsetup.exe, which holds the installation runtime code. You can open this file with WinRAR again and you will find an Execute.zip within it:
Opening this file, you will find a class com.sap.inst.devstudio.customactions.ValidateJDK which you can decompile using DJ for example. If you ask yourself, how you could have found this class without knowing – I just have extracted all archives and searched for the text “is lower than mininum required version”, which occurs when pointing to a JDK 1.4.2 for example (see first screenshot), and which is very unique for it’s misspelling (“mininum”):
This class reads two variables called JDK_MIN_VERSION and JDK_MAX_VERSION from some proxy object and checks the current chosen JDK version against these:
The question now is how does the installer retrieve the values of these variables?!
Again a search for these variable names brings up the file InstallScript.iap_xml within Execute.zip:
Within this XML file, you will find the values you might already have observed being set when running the installer, here for example for the minimum JDK version:
Googling for com.zerog.ia.installer.actions.EditVariableTable shows that this an InstallAnywhere variable definition. One idea could be just to overwrite these values within the XML and to rebuild the IDEsetup.exe, but at least WinRAR is not able to handle replacements within SFX ZIPs (there are other tools on the market which could do the trick, but you’ll see that the approach offered in the end will be much easier).
Some extra minutes googling around for possibilities how to set InstallAnywhere variables leads to http://www.zerog.com/iamanual/usermanual_ia71/en/WebHelp/silent_installers.htm – which explains that one can just create an installer.properties file with the properties set within it, here for example: JDK_MAX_VERSION=2.0 (which should be sufficient for some time…).
So, the simple solution to install NWDS 7.1 with a JDK 6 target is to create this properties file within the directory in which you have extracted the downloaded RAR. That’s all!
After that, just install NWDS 7.1, targeting at a JDK 6 installation. No complains about a wrong JDK version will pop up! Happy NWDSing!