Access static enum fields using JNI invocation API

Posted by Xinus on Stack Overflow See other posts from Stack Overflow or by Xinus
Published on 2010-05-16T12:01:03Z Indexed on 2010/05/16 12:10 UTC
Read the original article Hit count: 419

Filed under:
|
|

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 ?

© Stack Overflow or respective owner

Related posts about jni

Related posts about java