Update java in macOS x64

Android requires java 17 in Qt 6.8 and RTA needs java 17 into VMs
to compile Qt examples.

Task-number: QTQAINFRA-6492
Change-Id: I873c188154c2eae2a9eebddb94279c41ca822576
Reviewed-by: Johanna Äijälä <johanna.aijala@qt.io>
Reviewed-by: Ville-Pekka Karhu <ville-pekka.karhu@qt.io>
(cherry picked from commit 73cc61c389)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Matti Paaso
2024-08-13 09:46:08 +03:00
committed by Qt Cherry-pick Bot
parent 26c0acf266
commit c1edd84a8a

View File

@@ -1,17 +1,20 @@
#!/usr/bin/env bash
# Copyright (C) 2021 The Qt Company Ltd.
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# This script installs JDK
set -ex
source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh"
echo "Installing Java Development Kit"
version=11.0.12
targetFile=jdk-${version}_osx-x64_bin.dmg
version=17.0.12
targetFile=jdk-${version}_macos-x64_bin.dmg
expectedHash="6fba2fbe5d181bd2ef7fd79e0335278c13f611cb"
url=ci-files01-hki.ci.qt.io:/hdd/www/input/mac
# url_alt=https://www.oracle.com/java/technologies/downloads/#java11-linux
# url_alt=https://www.oracle.com/java/technologies/downloads/#jdk17-mac
echo "Mounting $targetFile"
sudo mkdir -p /Volumes/files
@@ -19,6 +22,8 @@ sudo mount -o locallocks "$url" /Volumes/files
sudo cp "/Volumes/files/$targetFile" /tmp
sudo umount /Volumes/files
cd /tmp
VerifyHash "$targetFile" "$expectedHash"
sudo hdiutil attach "/tmp/$targetFile"
echo Installing JDK