ok = JSJ_callbacks->create_java_vm(&jsjava_vm->java_vm, &jsjava_vm->main_thread_env, jsjava_vm->init_args); if (!ok || jsjava_vm->java_vm == NULL) {
ok = JSJ_callbacks->create_java_vm(&jsjava_vm->java_vm, &jsjava_vm->main_thread_env, jsjava_vm->init_args); if (!ok) {
jsj_ConnectToJavaVM(JSJavaVM *jsjava_vm){    if (!jsjava_vm->java_vm) {        JSBool ok;        JS_ASSERT(JSJ_callbacks->create_java_vm);        JS_ASSERT(JSJ_callbacks->destroy_java_vm);        ok = JSJ_callbacks->create_java_vm(&jsjava_vm->java_vm, &jsjava_vm->main_thread_env, jsjava_vm->init_args);        if (!ok || jsjava_vm->java_vm == NULL) {            jsj_LogError("Failed to create Java VM\n");            return JS_FALSE;        }        /* Remember that we created the VM so that we know to destroy it later */        jsjava_vm->jsj_created_java_vm = JS_TRUE;    }        if (!jsjava_vm->jsj_inited_java_vm) {        /*         * JVM initialization for netscape.javascript.JSObject is performed         * independently of the other classes that are initialized in         * init_java_VM_reflection, because we allow it to fail.  In the case         * of failure, LiveConnect is still operative, but only when calling         * from JS to Java and not vice-versa.         */        init_netscape_java_classes(jsjava_vm, jsjava_vm->main_thread_env);        /* Load the Java classes, and the method and field descriptors required for           Java reflection. */        if (!init_java_VM_reflection(jsjava_vm, jsjava_vm->main_thread_env) ||             !jsj_InitJavaObjReflectionsTable()) {            jsj_LogError("LiveConnect was unable to reflect one or more components of the Java runtime.\nGo to http://bugzilla.mozilla.org/show_bug.cgi?id=5369 for details.\n");            /* This function crashes when called from here.               Check that all the preconditions for this               call are satisfied before making it. [jd]               JSJ_DisconnectFromJavaVM(jsjava_vm); */            return JS_FALSE;        }                jsjava_vm->jsj_inited_java_vm = JS_TRUE;    }    return JS_TRUE;}