Skip to main content

JNI accessing Integer datatype

1 reply [Last post]
h_p
Offline
Joined: 2010-01-14
Points: 0

Hello,

I have a Java method which looks like:

public class Data {
Integer print();
}

To access this method in C++, I have the following JNI method:

JNIEXPORT void JNICALL Java_GenericPeer_print (JNIEnv *jenv, jclass jcls, jobject data){

jclass peerCls = jenv->GetObjectClass(data);
jmethodID mGetValue = jenv->GetMethodID(peerCls, "print","()Ljava/lang/Integer;");
jobject o =jenv->CallObjectMethod(data, mGetValue);
cout<<"o = "<

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jesdisciple
Offline
Joined: 2008-05-01
Points: 0

Hi h_p,

Sorry I took so long to respond. By now you've probably found help elsewhere.

Anyway, JNI questions should go to http://forums.sun.com/forum.jspa?forumID=52 . However, please do come back to help out here. I don't use Java; I only try to garden a community out of this forum because I'm a FOSS geek.

--
Chris