Set Up the Eclipse Project for Streaming Lite Custom Java Adapter
Configure the development environment to create a Custom Java Adapter for our Streaming Lite project by copying required files from the SAP HANA system.
Overview
You will learn
- 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
Prerequisites
Prerequisites
- Proficiency: Beginner
- Tutorial: Introduction to Writing a Custom Java Adapter for Freezer Monitoring Lite
Steps
Create a folder on your computer to contain your project files. We will call our folder
"custom_java_adapter"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$STREAMING_HOME
> Don't forget to replace `<sid>` with your HANA System id and <Version> 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.
Open Eclipse/HANA Studio
Create a new Java Project
Set the project location as our
"custom_java_adapter"folder. Our project name iscustom_java_adapterClick next

Under the Source tab, click “Create new source folder”

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”.

Right click on our
"src"folder, and selectNew>Classto create a new Java class.
Create a New Java Class Create a new Java class in the folder
custom_java_adapter/src. Set the package name ascustom_java_adapter. Name the class"JavaAdapter". Only select"public static void main(String[] args)". ClickFinish.

We have now created a new class, and a corresponding `JavaAdapter.java` file in which we will develop our code.

Resources
Discussion
Share feedback on this tutorial or join the conversation in SAP Community.