最好不要再C中使用Java对象,你如果需要处理返回数据的话,可以定义字节数组作为一个方法的参数,这个Java和C通用,在Java中你自己再根据得到的字节数组把数据解析成对象

解决方案 »

  1.   

    FindClassjclass FindClass(JNIEnv *env, const char *name);This function loads a locally-defined class. It searches the directories and zip files specified by the CLASSPATH environment variable for the class with the specified name.
    LINKAGE:Index 6 in the JNIEnv interface function table.PARAMETERS:env: the JNI interface pointer.name: a fully-qualified class name (that is, a package name, delimited by “/”, followed by the class name). If the name begins with “[“ (the array signature character), it returns an array class. The string is encoded in modified UTF-8.
    看上边,要以"/"分隔而不是"."
      

  2.   

    建议转成jstring之类的方式。class不靠谱
      

  3.   

    jclass class_A = (*env)->FindClass(env, "test/A");
      

  4.   

    楼主,搞定了吗,我也遇到这样的问题。我看头文件中这样定义的。jclass FindClass(const char *name) {
            return functions->FindClass(this, name);这个name指的是绝对路径还是什么??为什么就找不到呢?   我们一起看吧!
      

  5.   

    name是包名加类名 比如;com/example/test
    test是一个类