cancel
Showing results for 
Search instead for 
Did you mean: 

Steps required to create Jar in NWDS for import in XI and use in UDF. Help!

Former Member
0 Kudos

Hi !

I'm a Java newbie. I've been reading about ejbs, NWDS, etc., but don't know how to set up a project in NWDS for the purpose of creating a jar file with a java class inside with methods to be called insde a UDF in graphical mapping. I understand that the imports inside the java class depend on each case. What type of project do I need to create in NWDS? Where do I put the class methods?

Thanks,

Matias.

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

> What type of project do I need to create in NWDS?

JavaProject.

> Where do I put the class methods?

Define a Class , by creating a Class in your Project and then in this create the correspodning methods.

Regards

Bhavesh

Former Member
0 Kudos

Hi Bhavesh !

Thats exactly what I meant. Ok, and after writing all my methods, I've noticed I can go to Project | Rebuild All, to get my ".class" files generated..

After that step, I can use the command line or a zip utility to make the .zip or .jar with all my .class files. Am I right ??

There is no "Build JAR Archive" option for this kind of project..Am I doing something wrong?

Thanks,

Regards,

Matias.

Former Member
0 Kudos

Hi Matias,

to create a jar you have to select the project and click Export from the context menu.

Select jar file from the dialog box, then follow the wizard.

Then you have to import the jar inside the integration repository as an imported archive and from your udf call the methods.

Do not forget to declare the package to be imported (the same defined in you class files: like com.sap.xi.Mappings) in the import box of the UDF editor.

Regards,

Sergio

Answers (2)

Answers (2)

VijayKonam
Active Contributor
0 Kudos

JAR stands for Java Archive, which is technically a zip archive. Hence there is no difference between a JAR file and ZIP file technically. As long as the packages as mentioned in the java source code are maintained the zip or jar, there should not be any problem importing them into XI.

VJ

justin_santhanam
Active Contributor
0 Kudos

Matias ,

If you have the class file with you,then go to command prompt and give the following command

jar -cf Test.jar Test.class

The above command will create u jar file.

Its not necessary that only jar files can be imported for mapping in UDF.Just zip the class file and import in imported archive. It will work.

Hope it helps.

Best regards,

raj.