// 设置VM参数 // vAddOption(string("-verbose")); vAddOption(sOption_ClassPath); vAddOption(sOption_AppHome); // VM初始化参数 JavaVMInitArgs vm_args; vm_args.version = 0x00010002; vm_args.options = vm_options; vm_args.nOptions = mctOptions; vm_args.ignoreUnrecognized = JNI_TRUE; // 装入JVM库 HINSTANCE hJVM = LoadLibrary(sJVMpath.c_str()); if( hJVM == NULL ){ vShowLastError("不能从下面的路径装入JVM:" + sJVMpath); return 0; } // 启动1.2/3/4 VM CreateJavaVM lpfnCreateJavaVM = (CreateJavaVM) GetProcAddress(hJVM, "JNI_CreateJavaVM"); jintVMStartupReturnValue = (*lpfnCreateJavaVM) (&jvm, &env, &vm_args); // 是否成功? if (jintVMStartupReturnValue FindClass(sStartupClass.c_str()); if (jclassStartup == NULL) { string sErrorMessage ="找不到启动类[" +sStartupClass + "]"; vShowError(sErrorMessage); vDestroyVM(env, jvm); return 0; } |
正在阅读:打造个性化Java启动器打造个性化Java启动器
2004-04-05 10:08
出处:中国计算机报
责任编辑:sdq
键盘也能翻页,试试“← →”键