install-jdk.sh 693 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. set -euo pipefail
  3. # Copyright (c) Contributors to the Open 3D Engine Project.
  4. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. #
  6. # SPDX-License-Identifier: Apache-2.0 OR MIT
  7. #
  8. JDK_VERSION="11.0.17.8.1"
  9. echo "Installing Corretto JDK ${JDK_VERSION}"
  10. curl -o /tmp/amazon-corretto-${JDK_VERSION}-macosx-x64.pkg https://corretto.aws/downloads/resources/${JDK_VERSION}/amazon-corretto-${JDK_VERSION}-macosx-x64.pkg
  11. if sudo installer -allowUntrusted -pkg /tmp/amazon-corretto-${JDK_VERSION}-macosx-x64.pkg -target / ; then
  12. rm /tmp/amazon-corretto-${JDK_VERSION}-macosx-x64.pkg
  13. else
  14. echo "Installation failed!"
  15. exit 1
  16. fi