diff --git a/build/conf/mac/Contents/MacOS/idea b/build/conf/mac/Contents/MacOS/idea index e6f4390374cd..2f7dd4016c37 100755 Binary files a/build/conf/mac/Contents/MacOS/idea and b/build/conf/mac/Contents/MacOS/idea differ diff --git a/native/MacLauncher/Launcher.m b/native/MacLauncher/Launcher.m index bb5d31a9b7db..2aed256f08f4 100644 --- a/native/MacLauncher/Launcher.m +++ b/native/MacLauncher/Launcher.m @@ -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()) {