B
Bill Medland
Is this not possible or am I doing it wrong?
I want a native method of a class to create an instance of an inner class.
/* A class with an inner class */
public final class A {
public B method_X() {
...
return new B(y, p, o);
}
public B method_Y() {
...
return native_I(...)
}
private native B native_I(...);
public final class B {
// some members
private B(String y, int p, boolean o) {
....
}
}
}
JNIEXPORT ....native_I(JNIEnv *env, jobject obj, ...) {
...
jclass cls = (*env)->FindClass(env, "com/..../A.B);
jmethodid mid = (*env)->GetMethodID(env, cls, "<init>",
"(Ljava/lang/String;IZ)V");
...
}
The FindClass is throwing NoClassDefFoundError
Is that
a. because it cannot handle inner classes
b. because I have written the name wrong
c. I don't know what I am talking about
d. ...
TIA
I want a native method of a class to create an instance of an inner class.
/* A class with an inner class */
public final class A {
public B method_X() {
...
return new B(y, p, o);
}
public B method_Y() {
...
return native_I(...)
}
private native B native_I(...);
public final class B {
// some members
private B(String y, int p, boolean o) {
....
}
}
}
JNIEXPORT ....native_I(JNIEnv *env, jobject obj, ...) {
...
jclass cls = (*env)->FindClass(env, "com/..../A.B);
jmethodid mid = (*env)->GetMethodID(env, cls, "<init>",
"(Ljava/lang/String;IZ)V");
...
}
The FindClass is throwing NoClassDefFoundError
Is that
a. because it cannot handle inner classes
b. because I have written the name wrong
c. I don't know what I am talking about
d. ...
TIA