Liberica JDK: Updating Time Zone Data

1. Introduction

Liberica JDK includes the timezone data file tzdb.dat that contains information about local time options/properties, including UTC offsets and daylight saving time (DST) changes in different countries. This information is sometimes changed, and thus such data in Liberica JDK may become obsolete before a new build of Liberica JDK is released.

The Time Zone Database (often called tz or zoneinfo ) contains code and data that represent the history of local time for many representative locations around the globe. The Time Zone Database is now hosted by the Internet Assigned Numbers Authority (IANA).

IANA Updater

IANAUpdater is the tool that updates the Time Zones information in Liberica JDK and potentially other OpenJDK-based distributions.

IANAUpdater reads timezone data from IANA Time Zone Database and converts it into binary format of the file tzdb.dat used in Liberica JDK.

Ensure that you have sufficient privileges to modify the JDK_HOME/jre/lib or JRE_HOME/lib directory to successfully update timezone data.

2. Using IANA Updater

  1. Download IANAUpdater.

  2. Run the IANAUpdater tool with the following command:

    java -jar IANAUpdater.jar [-options]

    If no option is provided, the list of available options is displayed.

Available options

OptionDescriptionMandatory

-t, --target

Path to Liberica runtime base installation directory which contains file tzdb.dat in one of its subdirectories, or the absolute path to tzdb.dat file.

Yes

-z, --tzbundle

Absolute path to the new timezone data bundle file or URL link to the new IANA timezone data bundle.

Yes

-q, --quiet

Switch to silent mode (do not display any messages).

No

-v, --version

Print the version number of IANAUpdater and exit.

No

Examples

Note:
In the following examples we use IANA Updater version 20230215, which is the latest version by the time of creating this document.
  • Update Liberica JDK which can be found in ${JAVA_HOME} with time zone data provided in a file:

    java -jar IANAUpdater-20230215.jar -t ${JAVA_HOME} -z tzdata2021a.tar.gz
  • Update Liberica JDK tzdb.dat with time zone data provided in a file:

    java -jar IANAUpdater-20230215.jar -t ${JAVA_HOME}/jre/lib/tzdb.dat -z tzdata2021a.tar.gz
  • Update Liberica JDK tzdb.dat with time zone data from web URL:

    java -jar IANAUpdater-20230215.jar -t ${JAVA_HOME} -z https://data.iana.org/time-zones/releases/tzdata2021a.tar.gz
  • Quietly update {PRODUCT_NAME tzdb.dat with time zone data provided in a file:

    java -jar IANAUpdater-20230215.jar -t ${JAVA_HOME} -z tzdata2021a.tar.gz -q
ON THIS PAGE