我调用java中的jni, 定义了一个变量:
static JavaVM *pMyJavaVm=NULL,
并且在函数中赋值:
env->GetJavaVM(&pMyJavaVm);
但是当我要用到 pMyJavaVm的时候 打印发现 值为NULL ,这是为什么呢?
大家讲道理2017-04-17 17:29:51
The problem is solved, mainly due to the lack of thorough understanding of the C language. It is defined in a global header file, static JavaVM* pMyJavaVm; is included in several cpp files, and the variables in each file are independent, so Citing in other documents is problematic