Android: Look for latest JDK version and not 1.8 specifically

Recent SDK Manager that is used by Qt Creator works with JDK 11+,
and JDK 11 is needed by Qt 5.15.7+, so look for the newest JDK
instead of 1.8 as currently being done.

Change-Id: I6ff415aa300d742735e8636b24a03116d5bfe2b6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Assam Boudjelthia
2022-03-26 18:53:44 +02:00
parent 8170501502
commit f079479756
4 changed files with 29 additions and 43 deletions

View File

@@ -120,7 +120,7 @@ void AndroidToolChain::addToEnvironment(Environment &env) const
env.set(QLatin1String("ANDROID_NDK_HOST"), config.toolchainHostFromNdk(m_ndkLocation));
const Utils::FilePath javaHome = config.openJDKLocation();
if (javaHome.exists()) {
env.set(QLatin1String("JAVA_HOME"), javaHome.toUserOutput());
env.set(Constants::JAVA_HOME_ENV_VAR, javaHome.toUserOutput());
const FilePath javaBin = javaHome.pathAppended("bin");
const FilePath currentJavaFilePath = env.searchInPath("java");
if (!currentJavaFilePath.isChildOf(javaBin))