For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!
Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.
// C code (very simple example without error checking): JavaVM * jvm = NULL; jint create_jvm() { JavaVMInitArgs vm_args; JavaVMOption options[1]; JNIEnv * env; options[0].optionString = "-Djava.class.path=."; vm_args.options = options; vm_args.nOptions = 1; vm_args.version = JNI_VERSION_1_4; vm_args.ignoreUnrecognized = JNI_FALSE; return JNI_CreateJavaVM(&jvm, (void **)&env, &vm_args); }
// C code (very simple example without error checking): typedef jint (*type_JNI_CreateJavaVM)(JavaVM ** pJvm, JNIEnv ** pEnv, void * vmArgs); HINSTANCE hLib = NULL; JavaVM * jvm = NULL; jint create_jvm() { type_JNI_CreateJavaVM fct_JNI_CreateJavaVM; JavaVMInitArgs vm_args; JavaVMOption options[1]; JNIEnv * env; hLib = LoadLibrary("jvm.dll"); fct_JNI_CreateJavaVM = (type_JNI_CreateJavaVM)GetProcAddress(hLib, "JNI_CreateJavaVM"); options[0].optionString = "-Djava.class.path=."; vm_args.options = options; vm_args.nOptions = 1; vm_args.version = JNI_VERSION_1_4; vm_args.ignoreUnrecognized = JNI_FALSE; return (*fct_JNI_CreateJavaVM)(&jvm, &env, &vm_args); }