/* Invoke main method. */
(*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs);
if ((*env)->ExceptionOccurred(env)) {
/* Formerly, we used to call the "uncaughtException" method of the
main thread group, but this was later shown to be unnecessary
since the default definition merely printed out the same exception
stack trace as ExceptionDescribe and could never actually be
overridden by application programs. */
(*env)->ExceptionDescribe(env);
goto leave;
}
/*
* Detach the current thread so that it appears to have exited when
* the application's main method exits.
*/
if ((*vm)->DetachCurrentThread(vm) != 0) {
fprintf(stderr, "Could not detach main thread.\n");
goto leave;
}
ret = 0;
回复人: qqbz(qqbz)
我想不是突然关机,可能是突然关闭程序,非正常途径。
The virtual machine is terminated in response to a user interrupt, such as typing ^C, or a system-wide event, such as user logoff or system shutdown.