Page 1 of 1

Calling java from C

PostPosted: Thu Mar 21, 2013 3:42 pm
by anandhakrishna
Hi guys,

How to call java from C program in zOS. Got an info that jni.h would help this.

Kindly let me know how to proceed.

Thanks

Re: Calling java from C

PostPosted: Thu Mar 21, 2013 5:59 pm
by NicC
By reading the relevant manual(s)? Once you have done that you can come back with any questions to clarify your understanding.

Re: Calling java from C

PostPosted: Sat Mar 30, 2013 3:59 am
by mwilliams
Well,
There is an interesting aspect with threads like this one.
I did a search on the internet on the very subject and the link to this thread pops up near to the very top of the search results.

As quick response, the Java Native Interface (JNI) provide the means of both extending Java with calls to native code (C, C++, etc) and embedding the Java virtual machine into native applications.

As for “calling java from C program in zOS”, may I suggest the following links:
http://enterprisesystemsmedia.com/article/the-java-native-interface-on-z-os

http://www.ibm.com/developerworks/java/tutorials/j-jni/section3.html

Re: Calling java from C

PostPosted: Wed Apr 10, 2013 6:08 pm
by claes_douglas
JNI is not specific to z/OS, it is standarised and will be available everywhere Java is.

The thing that is specific to EBCDIC based OS's like z/OS is that you have to make the calls to Java using ASCII strings, so for instance use #pragma convert or iconv(), depending on your needs. Other than that, it's JNI as usual.