Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 561 lines (493 sloc) 22.5 KB
#!/usr/bin/env bash
#
# update_jdk
SCRIPT_VERSION=1.15.0
#
# Downloads the latest x64 JRE/JDK tarball resp. the latest tzupdater zip
# from the web, extracts it and creates/updates a symlink called <type>_latest
# or tzupdater.jar. Supports multiple sources, such as oracle.com, java.com,
# jdk.java.net, and adoptopenjdk.net. The OS flavor of the JRE/JDK is determined
# by the OS that you are running. Linux and macOS are supported.
#
# It is part of the bashberries project
# see also https://github.com/jonelo/bashberries
#
# Copyright 2018 Johann N. Loefflmann
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Explicitly set the PATH
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SCRIPT_NAME="${0##*/}"
usage() {
cat << END
update_jdk v${SCRIPT_VERSION}, Copyright 2018 Johann N. Loefflmann
Downloads the latest x64 JRE/JDK tarball resp. the latest tzupdater zip from
the web, extracts it and creates/updates a symlink called <type>_latest
resp. tzupdater.jar. Supports multiple sources, such as oracle.com, java.com,
jdk.java.net, adoptopenjdk.net, and zulu.org. The latest timezone database can
be applied to the requested JRE/JDK as well so that you have the most possible
up to date JRE/JDK within a Java family from your preferred source. And since
the symlink always points to the latest JRE/JDK you can update the JRE/JDK
both fast and comfortable. The OS flavor of the JRE/JDK is determined by the
OS that you are running. Both GNU/Linux and macOS are supported.
Usage:
update_jdk [ [-h] | [-a] [-d] [-f] [-k] [-s source] [-t type] [path] ]
Options:
-a accept license. That is a required option if you want to
download the JRE, JDK or tzupdater from the Oracle site
(-t oracle.com). Please read the license at
www.oracle.com/technetwork/java/javase/terms/license/index.html
resp. at
http://www.oracle.com/technetwork/java/javasebusiness/downloads/
L-> tzupdater-lic-354297.txt
and allow the script to download the package by specifying this
option.
-d dry run. Don't download the JRE, JDK or tzupdater, just inform the
user.
-f force. Even if we have the JRE, JDK or tzupdater already, update it
again.
-h prints this help.
-k keep the downloaded .tar.gz resp. .zip, don't remove it at the end.
-s source. Supported values are
oc or oracle.com (Oracle binaries, default)
jc or java.com (Oracle binaries)
jn or jdk.java.net (OpenJDK binaries)
an or adoptopenjdk.net (OpenJDK binaries)
ac or azul.com (OpenJDK binaries)
-t type. Valid value depends on the source.
For -s oracle.com it can be
jdk (latest JDK)
jre (latest JRE)
sjre (latest Server JRE)
tzupdater (latest tzupdater)
For -s java.com it can be
jre (latest JRE)
For -s jdk.java.net this can be
openjdk12 (OpenJDK 12)
openjdk11 (OpenJDK 11)
openjdk10 (OpenJDK 10)
For -s adoptopenjdk.net it can be
openjdk11 (OpenJDK 11 with Hotspot)
openjdk11-openj9 (OpenJDK 11 with OpenJ9)
openjdk10 (OpenJDK 10 with Hotspot)
openjdk10-openj9 (OpenJDK 10 with OpenJ9)
openjdk9 (OpenJDK 8 with Hotspot)
openjdk9-openj9 (OpenJDK 8 with OpenJ9)
openjdk8 (OpenJDK 8 with Hotspot)
openjdk8-openj9 (OpenJDK 8 with OpenJ9)
For -s azul.com it can be
jdk11
jdk10
jdk9
jdk8
-v version. Prints out the version of this script.
-z after the JRE or JDK has been downloaded and extracted, the
latest tzupdater will be downloaded and applied to the JRE or JDK.
Requires -a to work.
Parameters:
path specifies the path where the JRE, JDK or tzupdater should be stored.
It will be created if it doesn't exist.
If omitted, .<type>/ will be used.
Examples:
./update_jdk -a
updates the JRE in ./jre/ and it creates a symlink called
jre_latest there.
./update_jdk -az myjres
updates the JRE in myjres and it updates the symlink called
jre_latest there. Additionally the latest timezone updater
is being downloaded and called so that the JRE's timezone database
also gets updated.
./update_jdk -a -t jdk /opt/java/
updates the JDK in /opt/java/ and it updates a symlink
called jdk_latest there.
./update_jdk -a -t tzupdater /opt/java/
updates the tzupdater in /opt/java/ and it updates a symlink
called tzupdater.jar there.
./update_jdk -az -s an -t openjdk11
downloads both the latest tzupdater from oracle.com and
the latest OpenJDK11 build from adoptopenjdk.net, applies the
latest timezone database from IANA to the OpenJDK by calling
the tzupdater tool. Symlink called .openjdk11/openjdk11_latest
will point to the latest and updated OpenJDK11 build.
END
exit 0
}
function detectOStag() {
# What OS are we running on?
local OS="$(uname -s)"
case "$OS" in
Darwin)
OS_TAG="osx"
;;
Linux)
OS_TAG="linux"
;;
Solaris)
OS_TAG="solaris"
;;
*)
printf "ERROR: Not supported on %s\n" "$OS"
exit 1
;;
esac
}
function licenseAcceptedRequired() {
if [ $1 -eq 0 ]; then
cat << EOM
ERROR: In order to allow this script to download the latest JRE, Server JRE
or JDK from oracle.com, please read and accept the license at
http://www.oracle.com/technetwork/java/javase/terms/license/index.html
by specifying the -a option to this script.
In order to allow this script to download the latest tzupdater from
oracle.com, please read and accept the license at
http://www.oracle.com/technetwork/java/javasebusiness/downloads/
L-> tzupdater-lic-354297.txt
by specifying the -a option to this script.
Use option -h to get more help.
EOM
exit 1
fi
}
# Download a webpage and store it to a file
# param1: the website
# param2: the file
function downloadWebsite() {
local WEBSITE="$1"
local OUTFILE="$2"
printf "INFO: Downloading %s and storing it to %s ...\n" "${WEBSITE}" "${OUTFILE}"
if [ -f "$OUTFILE" ]; then
rm "$OUTFILE"
fi
curl -Lo "$OUTFILE" "$WEBSITE"
if [ ! -f "$OUTFILE" ]; then
printf "FATAL: Download of webpage %s failed. Please check your internet connection.\n" "${WEBSITE}"
exit 1
fi
}
# Parse a file
# param1: the file
# param2: the regex
function parseFile() {
local INFILE="$1"
local REGEX=$2
if [ -f "$INFILE" ]; then
HTML=$(<"$INFILE")
fi
if [[ "$HTML" =~ $REGEX ]]; then
FOUND_ADDRESS="${BASH_REMATCH[1]}"
printf "INFO: Found %s in %s\n" "${FOUND_ADDRESS}" "${INFILE}"
else
printf "FATAL: Actual download address was not found in content of %s\n" "${INFILE}"
exit 1
fi
}
function main() {
detectOStag
# options
ACCEPT=0
DRYRUN=0
FORCE=0
KEEP=0
ZOPTION=0
TYPE="jre"
SOURCE="oracle.com"
while getopts ':afkht:dvzs:' OPTION
do
case $OPTION in
a) ACCEPT=1
;;
d) DRYRUN=1
;;
f) FORCE=1
;;
h) usage
;;
k) KEEP=1
;;
s) SOURCE="$OPTARG"
;;
t) TYPE="$OPTARG"
;;
v) printf "%s\n" "$SCRIPT_VERSION"
exit 0
;;
z) ZOPTION=1
;;
?) printf "ERROR: Option -%s is not a supported option.\n" "$OPTARG"
exit 1
;;
esac
done
shift $(($OPTIND -1))
SUFFIX=".tar.gz"
# option combination check
if [ "$SOURCE" = "oc" -o "$SOURCE" = "oracle.com" -o $ZOPTION -eq 1 ]; then
licenseAcceptedRequired $ACCEPT
fi
if [ "$SOURCE" = "oc" -o "$SOURCE" = "oracle.com" ]; then
if [ "$TYPE" != "jre" -a "$TYPE" != "sjre" -a "$TYPE" != "jdk" -a "$TYPE" != "tzupdater" ]; then
printf "ERROR: type %s is not supported by %s.\n" "$TYPE" "$SOURCE"
exit 1
fi
if [ "$OS_TAG" = "osx" -a "$TYPE" = "sjre" ]; then
printf "ERROR: type %s (server JRE) is not supported on macOS by %s.\n" "$TYPE" "$SOURCE"
exit 1
fi
fi
if [ "$SOURCE" = "an" -o "$SOURCE" = "adoptopenjdk.net" ]; then
# OS identifiers for the files are different on adoptopenjdk.net
if [ "$OS_TAG" = "osx" ]; then
OS_TAG="Mac"
OS_REGEX_TAG='[Mm]ac'
fi
if [ "$OS_TAG" = "linux" ]; then
OS_TAG="Linux"
OS_REGEX_TAG='[Ll]inux'
fi
if [ "$TYPE" != "openjdk11" -a "$TYPE" != "openjdk11-openj9" -a \
"$TYPE" != "openjdk10" -a "$TYPE" != "openjdk10-openj9" -a \
"$TYPE" != "openjdk9" -a "$TYPE" != "openjdk9-openj9" -a \
"$TYPE" != "openjdk8" -a "$TYPE" != "openjdk8-openj9" ]; then
printf "ERROR: type %s is not supported by %s.\n" "$TYPE" "$SOURCE"
exit 1
fi
# there is no openj9 on Mac
if [ "$OS_TAG" = "Mac" ]; then
if [ "$TYPE" = "openjdk11-openj9" -o \
"$TYPE" = "openjdk10-openj9" -o \
"$TYPE" = "openjdk9-openj9" -o \
"$TYPE" = "openjdk8-openj9" ]; then
printf "ERROR: type %s (a JDK .tar.gz) is not supported on macOS by %s.\n" "$TYPE" "$SOURCE"
exit 1
fi
fi
fi
if [ "$SOURCE" = "ac" -o "$SOURCE" = "azul.com" ]; then
if [ "$OS_TAG" = "osx" ]; then
OS_TAG="mac"
fi
fi
if [ "$SOURCE" = "jn" -o "$SOURCE" = "jdk.java.net" ]; then
if [ "$TYPE" != "openjdk12" -a "$TYPE" != "openjdk11" -a "$TYPE" != "openjdk10" ]; then
printf "ERROR: type %s is not supported by %s.\n" "$TYPE" "$SOURCE"
exit 1
fi
fi
if [ "$SOURCE" = "jc" -o "$SOURCE" = "java.com" ]; then
if [ "$TYPE" != "jre" ]; then
printf "ERROR: type %s is not supported by %s.\n" "$TYPE" "$SOURCE"
exit 1
fi
if [ "$OS_TAG" = "osx" ]; then
printf "ERROR: type %s (a JRE .tar.gz) is not supported on macOS by %s.\n" "$TYPE" "$SOURCE"
exit 1
fi
fi
# parameters
case $# in
0) TARGET_DIR="${SCRIPT_DIR}/.${TYPE}"
;;
1) TARGET_DIR="$1"
;;
*) printf "ERROR: none or one parameters are supported\n"
exit 1
;;
esac
# any jre, sjre, jdk, etc. with -z option is wanted
if [ "$TYPE" != "tzupdater" -a $ZOPTION -eq 1 ]; then
# get the tzupdater
"${SCRIPT_DIR}/${SCRIPT_NAME}" -a -t tzupdater "$TARGET_DIR"
fi
VERSION_FILE="${TARGET_DIR}/${TYPE}.version"
TEMP_FILE=/tmp/update_${TYPE}.$$
# create the configuration directory
if [ ! -d "${TARGET_DIR}" ]; then
printf "INFO: Making directory: %s\n" "${TARGET_DIR}"
mkdir -p "${TARGET_DIR}"
fi
printf "INFO: Checking for %s on %s ...\n" $TYPE $SOURCE
if [ $SOURCE = "oc" -o $SOURCE = "oracle.com" ]; then
if [ $TYPE = "tzupdater" ]; then
DOWNLOAD_ADDRESS="http://www.oracle.com/technetwork/java/javase/downloads/tzupdater-download-513681.html"
downloadWebsite "$DOWNLOAD_ADDRESS" "$TEMP_FILE"
# Find the address to the tzupdater .zip file
# e.g. http://download.oracle.com/otn-pub/java/tzupdater/2.1.0/tzupdater-2_1_0.zip
REGEX='(http://download.oracle.com/otn-pub/java/tzupdater/[^\"]+)\"'
parseFile "$TEMP_FILE" $REGEX
else # jre, sjre or jdk
DOWNLOAD_ADDRESS="http://www.oracle.com/technetwork/java/javase/downloads/index.html"
downloadWebsite "$DOWNLOAD_ADDRESS" "$TEMP_FILE"
# Find the actual JRE/JDK download page
# e.g. <a href="/technetwork/java/javase/downloads/jre10-downloads-4417026.html" target=""><img alt="Download JRE"
# <a align="center" target="" href="/technetwork/java/javase/downloads/sjre10-downloads-4417025.html"><img alt="Download JDK"
# <a href="/technetwork/java/javase/downloads/jdk10-downloads-4416644.html" target=""><img alt="Download JDK"
REGEX='href=\"(/technetwork/java/javase/downloads/'${TYPE}'[^\"]+)\"([^>]*)>[[:space:]]*<img[[:space:]]+alt=\"Download[[:space:]]'
parseFile "$TEMP_FILE" $REGEX
DOWNLOAD_ADDRESS="http://www.oracle.com/${FOUND_ADDRESS}"
downloadWebsite "$DOWNLOAD_ADDRESS" "$TEMP_FILE"
# Parse for the .tar.gz file
# e.g. http://download.oracle.com/otn-pub/java/jdk/10.0.1+10/fb4372174a714e6b8c52526dc134031e/jre-10.0.1_linux-x64_bin.tar.gz
REGEX='(http://download.oracle.com/otn-pub/java/[^_]+_'${OS_TAG}'[^\.]+\.tar\.gz)\"'
parseFile "$TEMP_FILE" $REGEX
fi
elif [ $SOURCE = "an" -o $SOURCE = "adoptopenjdk.net" ]; then
if [ "${TYPE}" = "openjdk9" -o "${TYPE}" = "openjdk11" ]; then
DOWNLOAD_ADDRESS="https://github.com/AdoptOpenJDK/${TYPE}-binaries/releases/latest"
else
DOWNLOAD_ADDRESS="https://github.com/AdoptOpenJDK/${TYPE}-releases/releases/latest"
fi
downloadWebsite "$DOWNLOAD_ADDRESS" "$TEMP_FILE"
REGEX='tag/([^"]+)'
parseFile "$TEMP_FILE" $REGEX
# pattern for openjdk9 and openjdk11
if [ ${TYPE} = "openjdk9" -o ${TYPE} = "openjdk11" ]; then
# https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.1%2B13/OpenJDK11U-jdk_x64_mac_hotspot_11.0.1_13.tar.gz
# https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11%2B28/OpenJDK11-jdk_x64_mac_hotspot_11_28.tar.gz
# e.g. https://github.com/AdoptOpenJDK/openjdk9-binaries/releases/download/jdk-9.0.4%2B11/OpenJDK9U_x64_mac_hotspot_2018-08-08-15-47.tar.gz
REGEX='href=\"(/AdoptOpenJDK/'${TYPE}'-binaries/releases/download/'${FOUND_ADDRESS}'/[^_]+_x64_'${OS_REGEX_TAG}'_hotspot_[\.0-9_]+\.tar\.gz)\"'
else
# pattern for openjdk8 and openjdk10
# e. g. <a href="/AdoptOpenJDK/openjdk10-releases/releases/download/jdk-10.0.2%2B13/OpenJDK10_x64_Linux_jdk-10.0.2.13.tar.gz" rel="nofollow" class="d-flex flex-items-center">
REGEX='href=\"(/AdoptOpenJDK/'${TYPE}'-releases/releases/download/'${FOUND_ADDRESS}'/[^_]+_x64_'${OS_TAG}'_'${FOUND_ADDRESS/\%2B/.}'\.tar\.gz)\"'
fi
parseFile "$TEMP_FILE" $REGEX
FOUND_ADDRESS="https://github.com${FOUND_ADDRESS}"
elif [ $SOURCE = "jn" -o $SOURCE = "jdk.java.net" ]; then
JDKVERSION=${TYPE:7} # remove the openjdk string
DOWNLOAD_ADDRESS="http://jdk.java.net/${JDKVERSION}/"
downloadWebsite "$DOWNLOAD_ADDRESS" "$TEMP_FILE"
# e.g. <td><a href="https://download.java.net/java/GA/jdk10/10.0.1/fb4372174a714e6b8c52526dc134031e/10//openjdk-10.0.1_linux-x64_bin.tar.gz">
# e.g. <td><a href="https://download.java.net/java/early_access/jdk11/20/GPL/openjdk-11-ea+20_linux-x64_bin.tar.gz">
# bash doesn't support non-greedy regex with the =~ comparator. We want to find the understore just before the $OS_TAG,
# but there is also an underscore in early_access, so we overcome this by hopping over at least two slashes in the path
REGEX='href=\"(https://download.java.net/([^/]+/){2}[^_]+_'${OS_TAG}'-x64_bin\.tar\.gz)\">'
parseFile "$TEMP_FILE" $REGEX
elif [ $SOURCE = "jc" -o $SOURCE = "java.com" ]; then
DOWNLOAD_ADDRESS="https://www.java.com/en/download/manual.jsp"
# e.g. <a title="Download Java software for Linux x64" href="http://javadl.oracle.com/webapps/download/AutoDL?BundleId=233162_512cd62ec5174c3487ac17c61aaa89e8" ...>
# Linux x64</a>
downloadWebsite "$DOWNLOAD_ADDRESS" "$TEMP_FILE"
IDENTIFIER='Linux[[:space:]]x64'
REGEX='(http[s]?://javadl.oracle.com/webapps/download/AutoDL\?BundleId=[^"]+)"[^>]*>[[:space:]]*'${IDENTIFIER}'</a>'
parseFile "$TEMP_FILE" $REGEX
elif [ $SOURCE = "ac" -o $SOURCE = "azul.com" ]; then
DOWNLOAD_ADDRESS="https://www.azul.com/downloads/zulu/zulu-${OS_TAG}"
downloadWebsite "$DOWNLOAD_ADDRESS" "$TEMP_FILE"
# e.g. https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-macosx_x64.tar.gz
REGEX='(https://cdn.azul.com/zulu/bin/[^\-]+-'${TYPE}'[^\-]*-'${OS_TAG}'[^_]+_x64.tar.gz)'
parseFile "$TEMP_FILE" $REGEX
fi
DOWNLOAD_ADDRESS="${FOUND_ADDRESS}"
ARCHIVE_FILE="${TARGET_DIR}/${DOWNLOAD_ADDRESS##*/}"
# cleanup
rm "$TEMP_FILE" 2> /dev/null
# Do we need to download the file actually?
# Let's check what we have downloaded in the past
if [ ! -f "${VERSION_FILE}" ]; then
printf "%s\n" "none" > "${VERSION_FILE}"
fi
WEHAVE=$(<"${VERSION_FILE}")
if [ "$DOWNLOAD_ADDRESS" != "$WEHAVE" -o $FORCE -eq 1 ]; then
if [ $DRYRUN -eq 1 ]; then
printf "INFO: DRY RUN: Would download %s and would save it to %s.\n" "$DOWNLOAD_ADDRESS" "$ARCHIVE_FILE"
exit 0
fi
printf "Downloading %s ...\n" "$DOWNLOAD_ADDRESS"
if [ -f "${ARCHIVE_FILE}" ]; then
rm "${ARCHIVE_FILE}"
fi
if [ "$SOURCE" = "oc" -o "$SOURCE" = "oracle.com" ]; then
curl -Lo "${ARCHIVE_FILE}" -j -k -L -H "Cookie: oraclelicense=accept-securebackup-cookie" "$DOWNLOAD_ADDRESS"
else
curl -Lo "${ARCHIVE_FILE}" "$DOWNLOAD_ADDRESS"
fi
if [ -f "${ARCHIVE_FILE}" ]; then
printf "%s\n" "${DOWNLOAD_ADDRESS}" > "${VERSION_FILE}"
printf "Extracting the file %s ...\n" "${ARCHIVE_FILE}"
if [ $TYPE = "tzupdater" ]; then
# find the path of the latest tzupdater by searching in the .zip file
LATEST=$(unzip -l "${ARCHIVE_FILE}" | grep tzupdater.jar)
LATEST=${LATEST##* }
# extracting the .zip
unzip -d "${TARGET_DIR}" -o "${ARCHIVE_FILE}"
else
if [ "${SUFFIX}" = ".tar.gz" ]; then
gunzip < "${ARCHIVE_FILE}" | tar xfv - -C "${TARGET_DIR}"
else
unzip -d "${TARGET_DIR}" -o "${ARCHIVE_FILE}"
fi
fi
# determine SYMLINK name
if [ $TYPE = "tzupdater" ]; then
SYMLINK="${TYPE}.jar"
else
if [ "${SUFFIX}" = ".tar.gz" ]; then
LATEST=$(gunzip < "${ARCHIVE_FILE}" | tar tvf - | grep '/bin/java$')
else
LATEST=$(unzip -l "${ARCHIVE_FILE}" | grep '/bin/java$')
fi
# extract the path from the .../bin/java string
LATEST=${LATEST##* } # remove until the first blank
LATEST=${LATEST%/*} # remove /java from the string
LATEST=${LATEST%/*} # remove /bin from the string
SYMLINK="${TYPE}_latest"
fi
# relative symlink preferred
BACKUP=$(pwd)
cd "${TARGET_DIR}"
# update the symlink
rm "${SYMLINK}" 2> /dev/null
ln -s "${LATEST}" "${SYMLINK}"
# restore the folder
cd "${BACKUP}"
if [ $KEEP -eq 0 ]; then
printf "Clean up ...\n"
rm "${ARCHIVE_FILE}"
fi
# any jre, sjre or jdk, etc. with -z option is wanted
if [ "$TYPE" != "tzupdater" -a $ZOPTION -eq 1 ]; then
# call the tzupdater by using the java binary from the JRE/JDK that we have just downloaded
# specify the expected property as I described in Jan 2007:
# https://lists.apple.com/archives/Java-dev/2007/Jan/msg00060.html
"${TARGET_DIR}/${TYPE}_latest/bin/java" -Djava.vendor="Oracle Corporation" -jar "${TARGET_DIR}/tzupdater.jar" -v -l
fi
if [ "$TYPE" != "tzupdater" ]; then
printf "\nNew binaries have been stored to folder %s\n" "${TARGET_DIR}/${LATEST}"
printf "Symlink has been created as %s\n" "${TARGET_DIR}/${SYMLINK}"
EXECUTABLE="${TARGET_DIR}/${SYMLINK}/bin/java"
# specifying a 10 MB max heap in order to avoid too big heap values on large systems due to Java's ergonomics
printf "\nExecuting \"%s -Xmx10m -version\" ...\n" "${EXECUTABLE}"
"${TARGET_DIR}/${SYMLINK}/bin/java" -Xmx10m -version
fi
else
printf "FATAL: Download failed.\n"
exit 1
fi
else
printf "Skipping download, because it seems that you have downloaded %s already in the past. Use -f to force a download.\n" $DOWNLOAD_ADDRESS
if [ "$TYPE" = "tzupdater" ]; then
SYMLINK="${TYPE}.jar"
else
SYMLINK="${TYPE}_latest"
fi
printf "\nSymlink in order to access it, was stored as %s:\n" "${TARGET_DIR}/${SYMLINK}"
ls -la "${TARGET_DIR}/${SYMLINK}"
# any jre, sjre or jdk, etc. with -z option is wanted
if [ "$TYPE" != "tzupdater" -a $ZOPTION -eq 1 ]; then
# call the tzupdater by using the java binary from the JRE/JDK that we downloaded in the past
"${TARGET_DIR}/${TYPE}_latest/bin/java" -Djava.vendor="Oracle Corporation" -jar "${TARGET_DIR}/tzupdater.jar" -v -l
fi
fi
}
main "$@"