How can we access static enum fields using JNI invocation API
I am trying to access glassfish org.glassfish.api.embedded.ContainerBuilder.Type enumeration from Glassfish api using following code
jclass Type= env->FindClass(
"org/glassfish/api/embedded/ContainerBuilder$Type");
jfieldID Type_web=env->GetStaticFieldID(
Type,"web","org/glassfish/api/embedded/ContainerBuilder$Type");
But it always gives me error as Exception in thread "main" java.lang.NoSuchFieldError: web, How can I access that field ?
Actually I was missing L at front and ; at end of classname, I done following changes
jfieldID Type_web=env->GetStaticFieldID(
Type,"web","Lorg/glassfish/api/embedded/ContainerBuilder$Type;");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With