Default to the newer version path when checking Android Studio Java path (#101862)

This commit is contained in:
Lau Ching Jun
2022-04-13 22:49:06 -07:00
committed by GitHub
parent 41b73894bc
commit c2dc92ca88
2 changed files with 86 additions and 5 deletions

View File

@@ -445,9 +445,9 @@ class AndroidStudio implements Comparable<AndroidStudio> {
}
final String javaPath = globals.platform.isMacOS ?
version != null && version.major >= 2020 ?
globals.fs.path.join(directory, 'jre', 'Contents', 'Home') :
version != null && version.major < 2020 ?
globals.fs.path.join(directory, 'jre', 'jdk', 'Contents', 'Home') :
globals.fs.path.join(directory, 'jre', 'Contents', 'Home') :
globals.fs.path.join(directory, 'jre');
final String javaExecutable = globals.fs.path.join(javaPath, 'bin', 'java');
if (!globals.processManager.canRun(javaExecutable)) {