typedef jint(JNICALL *pCreateJavaVM)(JavaVM **, void**, void *); HMODULE dll = LoadLibrary("client/jvm.dll"); pCreateJavaVM CreateJavaVM = (pCreateJavaVM) GetProcAddress(dll, "JNI_CreateJavaVM"); JavaVM *jvm; JNIEnv *env; JavaVMInitArgs vm_args; vm_args.version = JNI_VERSION_1_8; JavaVMOption options[1]; options[0].optionString = "-Djava.class.path=bin/hero.jar"; vm_args.options=options; vm_args.nOptions = 1; CreateJavaVM(&jvm, (void**)&env, &vm_args); jclass cls = env->FindClass("cave/client/Game"); jmethodID mid = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V"); jobjectArray arg = env->NewObjectArray(0, env->FindClass("java/lang/String"), 0); env->CallStaticVoidMethod(cls, mid, arg); jvm->DestroyJavaVM();