Bug in JNI RegisterNatives?

Juerg Lehni juerg@scratchdisk.com
Tue May 30 08:49:00 GMT 2006


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


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /