Set Up the Eclipse Project for Streaming Lite Custom Java Adapter
- How to copy over the Java SDK files required from our HANA system to HANA Studio/Eclipse
- How to prepare the HANA Studio for Custom Java Adapter development
- Step 1
Create a folder on your computer to contain your project files. We will call our folder
Connect to your SAP HANA system in
WinSCP, and navigate to the directory
/hana/shared/<sid>/streaming-<Version>/STREAMING-2_0. This is the Streaming Analytics installation folder, and its path is defined in
Don’t forget to replace
<sid>with your HANA System id and
with your Streaming Analytics instance version
Copy over the
"libj"folder into your
"custom_java_adapter"folder. These are Java SDK files required to build our custom Java Adapter.
For the question below, select the correct answer, and click Validate.
Why is the 'libj' folder copied over from the SAP HANA system?
- Step 2
Open Eclipse/HANA Studio
Create a new Java Project
Set the project location as our
"custom_java_adapter"folder. Our project name is
- Step 3
Under the Source tab, click “Create new source folder”
In the window which pops up, name the folder
"src"and click finish, to create a folder called
"src". You will now see this folder displayed under our project directory in the “Source” tab.
Check the box which says “Allow output folder for source folders”, and click finish. You have now created a new package called
custom_java_adapter. You can expand and view it under “Package Explorer”.
- Step 4
Right click on our
"src"folder, and select
New>Classto create a new Java class.
Create a new Java class in the folder
custom_java_adapter/src. Set the package name as
custom_java_adapter. Name the class
"JavaAdapter". Only select
"public static void main(String args)". Click
We have now created a new class, and a corresponding
JavaAdapter.javafile in which we will develop our code.