This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Bug in JNI RegisterNatives?
Thank you Bryce,
klass->name will give you the Utf8Const name. You may need to add a
friend declaration to java/lang/Class.h for this to work.
I just tried to do this but was running into troubles with needed
forward declarations in Class.h for JNIEnv and JNINativeMethod, both
needed to declare _Jv_JNI_RegisterNatives as a friend.
The way these are defined in jni.h, it seems to not be possible to
forward declare them in Class.h. A possible solution is to include
jni.h there, but before I go ahead I'd like to hear your opinion on
this. Another possibility is a function calld _Jv_GetClassName in
jni.cc that is declared friend in Class.h and does nothing else than
returning the name.
Jürg