mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Ability to specify boot jdk in a user preferences folder.
This commit is contained in:
Binary file not shown.
@@ -231,7 +231,26 @@ NSBundle *findMatchingVm() {
|
||||
return jdkBundle;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
|
||||
NSString *pathForFile = [NSString stringWithFormat:@"%@/%@.jdk", getPreferencesFolderPath(), getExecutable()];
|
||||
|
||||
if ([fileManager fileExistsAtPath:pathForFile]){
|
||||
NSString* fileContents = [NSString stringWithContentsOfFile:pathForFile encoding:NSUTF8StringEncoding error:nil];
|
||||
NSArray* allLinedStrings = [fileContents componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]];
|
||||
if (allLinedStrings.count > 0) {
|
||||
NSString* jdkFromProfile = allLinedStrings[0];
|
||||
NSBundle *jdkBundle = [NSBundle bundleWithPath:jdkFromProfile];
|
||||
if (jdkBundle != nil && ![jvmVersion(jdkBundle) isEqualToString:@"0"]) {
|
||||
// If the user chooses a VM, use it even if it doesn't satisfy Info.pList
|
||||
debugLog(@"User VM from IDE profile:");
|
||||
debugLog([jdkBundle bundlePath]);
|
||||
return jdkBundle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NSArray *vmBundles = [allVms() sortedArrayUsingFunction:compareVMVersions context:NULL];
|
||||
|
||||
if (isDebugEnabled()) {
|
||||
|
||||
Reference in New Issue
Block a user