/*
* Loads a class and verifies that the main class is present and it is ok to
* call it for more details refer to the java implementation.
*/static jclass
LoadMainClass(JNIEnv *env,int mode,char*name){
jmethodID mid;
jstring str;
jobject result;
jlong start, end;//@see:16.2.3.ShowSettings
jclass cls =GetLauncherHelperClass(env);NULL_CHECK0(cls);if(JLI_IsTraceLauncher()){
start =CounterGet();}//调用sun.launcher.LauncherHelper.java::checkAndLoadMain加载并校验主类NULL_CHECK0(mid =(*env)->GetStaticMethodID(env, cls,"checkAndLoadMain","(ZILjava/lang/String;)Ljava/lang/Class;"));
str =NewPlatformString(env, name);CHECK_JNI_RETURN_0(
result =(*env)->CallStaticObjectMethod(
env, cls, mid, USE_STDERR, mode, str));if(JLI_IsTraceLauncher()){
end =CounterGet();//2917 micro seconds to load main class//----_JAVA_LAUNCHER_DEBUG----printf("%ld micro seconds to load main class\n",(long)(jint)Counter2Micros(end-start));printf("----%s----\n", JLDEBUG_ENV_ENTRY);}return(jclass)result;}