comparison src/os/posix/launcher/java_md.c @ 4846:e8a4934564b2

7125793: MAC: test_gamma should always work Summary: Fix gamma launcher on Mac OS X and reconcile test_gamma script on Unix platforms Reviewed-by: dcubed, ohair, jcoomes, dholmes, ksrini Contributed-by: james.melvin@oracle.com
author phh
date Tue, 24 Jan 2012 19:33:14 -0500
parents f08d439fab8c
children b9a9ed0f8eeb
comparison
equal deleted inserted replaced
4843:d6660fedbab5 4846:e8a4934564b2
699 GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative) 699 GetJREPath(char *path, jint pathsize, char * arch, jboolean speculative)
700 { 700 {
701 char libjava[MAXPATHLEN]; 701 char libjava[MAXPATHLEN];
702 702
703 if (GetApplicationHome(path, pathsize)) { 703 if (GetApplicationHome(path, pathsize)) {
704
705 /* Is the JRE universal, i.e. no arch dir? */
706 sprintf(libjava, "%s/jre/lib/" JAVA_DLL, path);
707 if (access(libjava, F_OK) == 0) {
708 strcat(path, "/jre");
709 goto found;
710 }
711
704 /* Is JRE co-located with the application? */ 712 /* Is JRE co-located with the application? */
705 sprintf(libjava, "%s/lib/%s/" JAVA_DLL, path, arch); 713 sprintf(libjava, "%s/lib/%s/" JAVA_DLL, path, arch);
706 if (access(libjava, F_OK) == 0) { 714 if (access(libjava, F_OK) == 0) {
707 goto found; 715 goto found;
708 } 716 }
732 /* JVM is directly linked with gamma launcher; no dlopen() */ 740 /* JVM is directly linked with gamma launcher; no dlopen() */
733 ifn->CreateJavaVM = JNI_CreateJavaVM; 741 ifn->CreateJavaVM = JNI_CreateJavaVM;
734 ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs; 742 ifn->GetDefaultJavaVMInitArgs = JNI_GetDefaultJavaVMInitArgs;
735 return JNI_TRUE; 743 return JNI_TRUE;
736 #else 744 #else
737 Dl_info dlinfo; 745 Dl_info dlinfo;
738 void *libjvm; 746 void *libjvm;
739 747
740 if (_launcher_debug) { 748 if (_launcher_debug) {
741 printf("JVM path is %s\n", jvmpath); 749 printf("JVM path is %s\n", jvmpath);
742 } 750 }