extern "C" JNIEXPORT void JNICALL Java_com_ipcamer_testsetdata_JavaNative2_outputDate(JNIEnv *env, jclass jclazz) { // TODO jclass clazz_date = env->FindClass("java/util/Date"); jmethodID mid_date = env->GetMethodID(clazz_date,"<init>","()V"); jobject now = env->NewObject(clazz_date,mid_date); jmethodID time_date = env->GetMethodID(clazz_date,"getTime","()J");//得到getTime()方法 jlong t = env->CallLongMethod(now,time_date); cout << t << endl; }
jni调用底层的时间
最新推荐文章于 2024-01-23 13:41:00 发布