Calling java from C



Help for C/C++ for MVS, OS/390 C/C++, z/OS C/C++ and C/C++ Productivity Tools for OS/390

Calling java from C

Postby anandhakrishna » Thu Mar 21, 2013 3:42 pm

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
anandhakrishna
 
Posts: 6
Joined: Thu Feb 07, 2013 12:40 pm
Location: Chennai
Has thanked: 0 time
Been thanked: 0 time

Re: Calling java from C

 

Re: Calling java from C

Postby NicC » Thu Mar 21, 2013 5:59 pm

By reading the relevant manual(s)? Once you have done that you can come back with any questions to clarify your understanding.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2989
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 135 times

Re: Calling java from C

Postby mwilliams » Sat Mar 30, 2013 3:59 am

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
mwilliams
 
Posts: 11
Joined: Thu Feb 07, 2013 8:55 am
Has thanked: 0 time
Been thanked: 1 time

Re: Calling java from C

Postby claes_douglas » Wed Apr 10, 2013 6:08 pm

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.
claes_douglas
 
Posts: 3
Joined: Mon Sep 17, 2012 6:00 pm
Has thanked: 1 time
Been thanked: 0 time


Return to C, C++

 


  • Related topics
    Replies
    Views
    Last post