Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JNI Function to call List

843829Dec 24 2008 — edited Dec 31 2008
Hi,
I'm new to JNI programming. I need to make a JNI function that takes 3 lists as parameters and within the function these lists are converted to some C++ datatype (char * or vector or whatever). Also this function will return some list. This is like the following.

JNIEXPORT JList JNICALL Java_function_ListManipulation
(JNIEnv *env, jobject obj, JList list1, JList list2, JList list3)
{
const char * st1 = (*env).<some conv_function>(list1, 0);
const char * st2 = (*env).<some conv_function>(list2, 0);
const char * st3 = (*env).<some conv_function>(list3, 0);
//Do something with st1, st2, st3
env->ReleaseStringUTFChars(prompt, nativeString);//May not be ReleaseStringUTFChars; May be some other function
}

Can any one help me in this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 28 2009
Added on Dec 24 2008
3 comments
637 views