Revert "Fix unable to find bundled Java version (#119244)" (#119981)

This reverts commit 57fd50f84e.
This commit is contained in:
godofredoc
2023-02-03 18:57:53 -08:00
committed by GitHub
parent 57fd50f84e
commit f7c2bd05f0
3 changed files with 6 additions and 182 deletions

View File

@@ -441,22 +441,11 @@ class AndroidStudio implements Comparable<AndroidStudio> {
return;
}
final String javaPath;
if (globals.platform.isMacOS) {
if (version != null && version.major < 2020) {
javaPath = globals.fs.path.join(directory, 'jre', 'jdk', 'Contents', 'Home');
} else if (version != null && version.major == 2022) {
javaPath = globals.fs.path.join(directory, 'jbr', 'Contents', 'Home');
} else {
javaPath = globals.fs.path.join(directory, 'jre', 'Contents', 'Home');
}
} else {
if (version != null && version.major == 2022) {
javaPath = globals.fs.path.join(directory, 'jbr');
} else {
javaPath = globals.fs.path.join(directory, 'jre');
}
}
final String javaPath = globals.platform.isMacOS ?
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)) {
_validationMessages.add('Unable to find bundled Java version.');