@@ -89,20 +89,16 @@ int launch(char *commandName) {
89
89
// Locate the JLI_Launch() function
90
90
NSString *runtime = [infoDictionary objectForKey: @JVM_RUNTIME_KEY];
91
91
92
- JLI_Launch_t jli_LaunchFxnPtr;
92
+ JLI_Launch_t jli_LaunchFxnPtr = NULL ;
93
93
if (runtime != nil ) {
94
94
NSURL *runtimeBundleURL = [[[NSBundle mainBundle ] builtInPlugInsURL ] URLByAppendingPathComponent: runtime];
95
95
CFBundleRef runtimeBundle = CFBundleCreate (NULL , (CFURLRef)runtimeBundleURL);
96
96
97
97
NSError *bundleLoadError = nil ;
98
98
Boolean runtimeBundleLoaded = CFBundleLoadExecutableAndReturnError (runtimeBundle, (CFErrorRef *)&bundleLoadError);
99
- if (bundleLoadError != nil || !runtimeBundleLoaded) {
100
- [[NSException exceptionWithName: @JAVA_LAUNCH_ERROR
101
- reason: NSLocalizedString(@" JRELoadError" , @UNSPECIFIED_ERROR)
102
- userInfo: nil ] raise ];
99
+ if (bundleLoadError == nil && runtimeBundleLoaded) {
100
+ jli_LaunchFxnPtr = CFBundleGetFunctionPointerForName (runtimeBundle, CFSTR (" JLI_Launch" ));
103
101
}
104
-
105
- jli_LaunchFxnPtr = CFBundleGetFunctionPointerForName (runtimeBundle, CFSTR (" JLI_Launch" ));
106
102
} else {
107
103
void *libJLI = dlopen (LIBJLI_DYLIB, RTLD_LAZY);
108
104
if (libJLI != NULL ) {
@@ -112,7 +108,7 @@ int launch(char *commandName) {
112
108
113
109
if (jli_LaunchFxnPtr == NULL ) {
114
110
[[NSException exceptionWithName: @JAVA_LAUNCH_ERROR
115
- reason: NSLocalizedString(@" JRENotFound " , @UNSPECIFIED_ERROR)
111
+ reason: NSLocalizedString(@" JRELoadError " , @UNSPECIFIED_ERROR)
116
112
userInfo: nil ] raise ];
117
113
}
118
114
0 commit comments