To write and compile Java code / Java Mapping we need Java SDK installed on our local machine and better to have a Java editor for syntax check, project organization, compile and run the java code in efficient manner.
This blog I would like to show two things:
- How to download and setup Java on your local machine.
- How to download and setup NWDS with existing Java installation.
This is an absolute necessary configuration before you begin writing Java program and running on local machine. For us, to develop Java Mapping or Adapter Module we need these tools and proper environment setup to have strong platform to develop.
Step 1: Download, Install & Configure Java SDK
If do not have Java installed then get Java 1.6 from here.
Check what version is available on local machine is the first step.
Open “Run” Command and type “cmd“.
If you are planning to write Java mapping for <= PI 7.3 then my preference is to have 1.6 Java version and if < PI 7.1 then Java 1.5 or less.
For my PI 7.1 version, I remove the 1.8 and installed Java SDK 1.4
Another way to check what version of Java installed. Open Control Panel and find Java by searching or going under the “program” category as below:
Click on Java -> View
You can add you default Java settings that is required for your environment.
Java not found from the Command Prompt?
If the Java program is not working from the command prompt then search for this locations:
Sometimes it will get install on C:\ drive home folder or under C:\Program Files (x86)\Java
Lastly is to set the Environment Variables to make sure java is executed from the cmd prompt.
Search the System Variable -> Path and in the end add the bin folder path of the Java.
Now go back and run the “java -version” command from the “cmd” prompt.
For me, I see the right version installed so I can proceed with NWDS download and configuration.
If you have any issues in installing Java then let me know from here to get the software.
Step 2: Download, Install & Configure NWDS
How to dowload NWDS from SAP Site?
Here are some of the links but you need OSS ID & PWD to download from SAP.
PI 7.3 Downloads - > https://nwds.sap.com/swdc/downloads/updates/netweaver/nwds/nw/730/doc/auto_latest_distributions.html or Download >> Support Packages and Patches >> Support Packages and Patches - Entry byApplication Group - Entry by Application Group >> SAP NetWeaver >> SAP NETWEAVER >> select SAP NETWEAVER Version as you want >> Entry by Component >> Developer Studio
Another best and easy option is to drop me a line from here.
Running NWDS for the first time
If Software does not load or refer to wrong Java version then open the .ini file and edit this settings as below:
First thing to do is to change the perspective of the NWDS:
Java perspective is used to write simple desktop utility and Java mapping
J2EE perspective is probably used for web pages, EJB, Adapter Modules.
Generally, the perspective is shown on the right hand side corner for easy reference.
Next the Java settings in the NWDS:
Open Window menu -> Preferences
You can add your required JSDK version to write the Java programming. Depending on the XI / PI version of Java support we configure NWDS to develop and compile the code.
Create a workspace and configure it:
Workspace is just a folder on the file system that we need to indicate to NWDS to store all projects and configuration in this folder.
Click on File -> Switch Workspace -> Other and points to the folder that you like to save the projects.
Create a Sample Project:
When you create projects remember following things:
- Naming convention of the project.
- Location where the project is saved, if you have selected workspace then it will save under it by default.
- Check Java SDK that is used for this project. You can configure the JRE from the link below.
- Don’t forget the basics, Use SDK instead of JRE to develop java program.
Once you have created the project you need to notice the project name and Java SDK version which is very important.
I think this is enough to start developing the Java mapping or Adapter Module or any Java tools. Let me know if you are facing any issue in configuring Java or NWDS from here.