From 0afe354952416e55193ce908e7018ec982ef9dcd Mon Sep 17 00:00:00 2001 From: Artem Sokolovskii Date: Thu, 8 Feb 2024 10:29:35 +0100 Subject: [PATCH] Android: Update Android Stidio jdk detection Fixes: QTCREATORBUG-28866 Fixes: QTCREATORBUG-30322 Change-Id: Id7908301a6c6acb540e6a7d575cc6b8b95cdf5d6 Reviewed-by: Alessandro Portale --- src/plugins/android/androidconfigurations.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index 2b0bd9492e0..21a20ff645c 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -1479,9 +1479,12 @@ FilePath AndroidConfig::getJdkPath() // Look for Android Studio's jdk first const FilePath androidStudioSdkPath = androidStudioPath(); if (!androidStudioSdkPath.isEmpty()) { - const FilePath androidStudioSdkJrePath = androidStudioSdkPath / "jre"; - if (androidStudioSdkJrePath.exists()) - jdkHome = androidStudioSdkJrePath; + const QStringList allVersions{"jbr", "jre"}; + for (const QString &version : allVersions) { + const FilePath androidStudioSdkJbrPath = androidStudioSdkPath / version; + if (androidStudioSdkJbrPath.exists()) + return androidStudioSdkJbrPath; + } } if (jdkHome.isEmpty()) {