|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# |
| 4 | +# Copyright (c) 2000, 2026, Oracle and/or its affiliates. |
| 5 | +# |
| 6 | +# Licensed under the Universal Permissive License v 1.0 as shown at |
| 7 | +# https://oss.oracle.com/licenses/upl. |
| 8 | +# |
| 9 | + |
| 10 | +# |
| 11 | +# Oracle internal script to pull down and unzip a JDK locally |
| 12 | +# |
| 13 | +# Command line: |
| 14 | +# . <workspace>/bin/cfglocal.sh [-reset] |
| 15 | +# |
| 16 | +# see <workspace>/bin/cfglocal.sh |
| 17 | + |
| 18 | +# The platform specific command used to locate the correct version of java |
| 19 | +# Note: this command is evaluated when required |
| 20 | +function get_java_home |
| 21 | + { |
| 22 | + _CURRENT_DIR=${DEV_ROOT:-`pwd`} |
| 23 | + cd $_CURRENT_DIR |
| 24 | + |
| 25 | + if [ 21 -eq $_VERSION_REQUIRED ]; then |
| 26 | + _JDK_VER=21.0.11 |
| 27 | + _JDK_BUILD=9 |
| 28 | + elif [ 17 -eq $_VERSION_REQUIRED ]; then |
| 29 | + _JDK_VER=17.0.19 |
| 30 | + _JDK_BUILD=9 |
| 31 | + else |
| 32 | + # default to 11 |
| 33 | + _JDK_VER=11.0.31 |
| 34 | + _JDK_BUILD=9 |
| 35 | + fi |
| 36 | + |
| 37 | + _JAVA_HOME=`pwd`/jdk/jdk-${_JDK_VER} |
| 38 | + _JDK_BIN_FILE=jdk-${_JDK_VER}_windows-x64_bin.zip |
| 39 | + |
| 40 | + if [ ! -f $_JAVA_HOME/bin/java.exe ]; then |
| 41 | + if [ ! -f $_JDK_BIN_FILE ]; then |
| 42 | + # this version of curl does not support NO_PROXY or no_proxy |
| 43 | + HTTP_PROXY= HTTPS_PROXY= $_CURRENT_DIR/tools/wls/infra/curl.exe -k -o ${_JDK_BIN_FILE} http://slciajo.us.oracle.com/artifactory/re-release-local/jdk/${_JDK_VER}/${_JDK_BUILD}/bundles/windows-x64/${_JDK_BIN_FILE} |
| 44 | + fi |
| 45 | + fi |
| 46 | + |
| 47 | + if [ -n "$_JDK_BIN_FILE" ]; then |
| 48 | + mkdir -p jdk |
| 49 | + cd jdk |
| 50 | + unzip -q ../$_JDK_BIN_FILE |
| 51 | + rm -f ../$_JDK_BIN_FILE |
| 52 | + fi |
| 53 | + |
| 54 | + cd $_CURRENT_DIR |
| 55 | + unset _CURRENT_DIR |
| 56 | + unset _JDK_BIN_FILE |
| 57 | + unset _JDK_BUILD |
| 58 | + unset _JDK_VER |
| 59 | + echo $_JAVA_HOME |
| 60 | + } |
| 61 | + |
| 62 | +# download and add OpenSSL-Win64 to the PATH |
| 63 | +function get_openssl_home |
| 64 | + { |
| 65 | + _CURRENT_DIR=${DEV_ROOT:-`pwd`} |
| 66 | + cd ${_CURRENT_DIR} |
| 67 | + _OPENSSL_HOME=`pwd`/openssl/openssl-1.1.1j-win64-mingw |
| 68 | + |
| 69 | + if [ ! -f ${_OPENSSL_HOME}/openssl.exe ]; then |
| 70 | + mkdir -p openssl |
| 71 | + cd openssl |
| 72 | + if [ ! -f openssl-1.1.1j_4-win64-mingw.zip ]; then |
| 73 | + # this version of curl does not support NO_PROXY or no_proxy |
| 74 | + HTTP_PROXY= HTTPS_PROXY= $_CURRENT_DIR/tools/wls/infra/curl.exe -k -o openssl-1.1.1j_4-win64-mingw.zip http://tangosol-build.us.oracle.com:8081/artifactory/third-party-release/openssl/openssl/1.1.1j-win64/openssl-1.1.1j_4-win64-mingw.zip |
| 75 | + fi |
| 76 | + unzip -q openssl-1.1.1j_4-win64-mingw.zip |
| 77 | + rm -f openssl-1.1.1j_4-win64-mingw.zip |
| 78 | + fi |
| 79 | + |
| 80 | + cd $_CURRENT_DIR |
| 81 | + unset _CURRENT_DIR |
| 82 | + echo ${_OPENSSL_HOME} |
| 83 | + } |
0 commit comments