Timezone Updater Tool

By the Java SE Platform Support Team, September 2024

Introduction

The TZUpdater tool is provided to allow you to update installed Java Development Kit (JDK) and Java Runtime Environment (JRE) software with more recent timezone data, to accommodate daylight saving time (DST) changes in different countries. Oracle relies on the timezone data publicly available through IANA's Time Zone Database.

Oracle recommends that you use the latest Oracle Java SE platform JDK or JRE update release as the preferred means of delivering both timezone data updates and other product improvements, such as security fixes. To see which JDK or JRE update release incorporates the updated timezone data for your locale, see Timezone Data Versions in the JRE Software. However, if you are unable to use Oracle's latest JDK or JRE update release or if the timezone data on the latest release is not the most current one available, the TZUpdater tool provides a means of updating timezone data while leaving other system configuration and dependencies unchanged.

System Requirements

The TZUpdater tool supports all currently supported versions of the JDK. Prior to version 2.3.1, the tool only worked on Oracle binaries.

Download

A version of TZUpdater tool for updating the current version of Oracle’s Java Runtime Environment is available in Oracle Technology Network - Java SE Download Page.

Support customers can download a TZUpdater tool for older versions through My Oracle Support.

Usage

The TZUpdater tool modifies the JDK/JRE software instance that is used to execute the tool. A single image of the JDK/JRE software is modified per execution. To administer the tool to multiple instances of the JDK/JRE software, see the section Systemwide Usage.

You must stop any running instances of the JDK/JRE software to be operated upon before you run the TZUpdater tool on that installed JDK/JRE software image.

Run the TZUpdater tool with the following command:

java -jar tzupdater.jar options

To update timezone data successfully, you should ensure that you have sufficient privileges to modify the JDK_HOME /jre/lib or JRE_HOME /lib directory. If you do not have sufficient privileges to modify these directories, contact your system administrator.

Options

If you do not specify any options, the usage message is displayed. To update the timezone data, use either the -l or the -f option.

Option Description
-h, --help Print the usage to stdout and exit. Other options are ignored if you specify this option.
-V, --version Print tool version, tzdata version in JRE, and tzdata version that the tool would update to, and then exit.
-l, --location url-link-to-archive-file Compile, test and update JRE timezone data from the provided tzdata.tar.gz bundle, for example, -l https://www.iana.org/time-zones/repository/tzdata-latest.tar.gz . Supported URL protocols: http://, https://, file://. If no URL link is provided, the tool will use the latest IANA tzdata bundle at https://www.iana.org/time-zones/repository/tzdata-latest.tar.gz .
-f, --force Force a tzdata update. Use this option if updating to an older tzdata version.
-v, --verbose Display detailed messages to stdout .

Error Handling

The tool tries to restore the original state when it has encountered an unexpected error, such as lack of disk space.

Reporting Problems Against TZUpdater

If a user wishes to raise an issue against TZUpdater, please file a bug at https://bugs.java.com.

Tool Updates

  • 2.3.2 Bug Fix
    • JDK-8254226: tzupdater2.3.1 is broken with tzdata2020b

  • 2.3.1 Enhancement/Bug Fix
    • JDK-8245460: Allow all JDK vendors to work with TZUpdater

      Removed restriction of letting TZUpdater update only Oracle JDK binaries. The TZUpdater tool now allows updates to any JDK binary.
    • JDK-8245950: TZUpdater cannot update to tzdata2020a for JDK 7u
  • 2.3.0 Enhancements
    • The 2.3.0 release now supports the vanguard tzdata format which has not been supported since tzdata2018e . The following are the related bug fixes:

    • JDK-8230554 TZUpdater support for "vanguard" format (JSR-310 part only)
    • JDK-8229818: Add workaround to TZUpdater for converting tzdata files from vanguard to rearguard (JDK 7u only)

      TZUpdater tool usage for JDK 7u only has a workaround that involves translating vanguard to rearguard format before computation of javazic data sources.

      A new TZUpdater property, tzupdater.forceUseOfVanguard, is introduced as a fallback option if the TZUpdater fails due to unforeseen circumstances.

      The new TZUpdater property can be enabled by setting:
      -Dtzupdater.forceUseOfVanguard=true
  • 2.2.0 Bug Fix
    • JDK-8194474 (not public) : Remove use of security digest calculations from tzupdater

      The IANA website now provides https functionality to allow secure downloading of tzdata resource bundles. As a result, the SHA-512 digest calculations (and hosted files) for tzdata bundle downloads are no longer required.

    • JDK-8203908 : TZUpdater tool fails to print version info for the users without write permission
  • 2.1.2 Bug Fix
    • Updated the protocol used for connecting to IANA for downloading the latest time-zone information to match recent changes in the IANA sites.

    • JDK-8193405 (not public) : tzupdater.jar --version fails to correctly display latest version

  • 2.1.1 Bug Fix
    • JDK-8166928 : TZupdater failing with tzdata2016g release due to missing version information

  • 2.1 Enhancements
    • -u Option Removed

      Use the -l option to update data. For information on this option and other options available, pass the -h option to the tool as shown in the following example:

      java -jar tzupdater.jar -h
    • The tzupdater.jar file is digitally signed. Use the following command to verify the signature: jarsigner -verify -verbose -certs tzupdater.jar
  • 2.0.3 Bug Fix
    • JDK-8151879 : TZupdater not able to update with tzdata2016b release

  • 2.0.2 Bug Fix
    • JDK-8149811 : TZUpdater tool removes PST timezone from Java 7

  • 2.0 Enhancements
    • New TZUpdater Functionality: Updating Timezones On Demand

      Starting with version 2.0, the "-l" option allows the user to point to the IANA repositories and get the tool to compile the latest tzdata sources on demand.

      The tool also references a https resource website for SHA-512 hash values if the -l option is specified with a http or https protocol.

      For this reason, any environment which operates with proxy access, will need to set the http and https proxy values while running the tool.

      HTTP: -Dhttp.proxyHost, -Dhttp.proxyPort HTTPS : -Dhttps.proxyHost, -Dhttps.proxyPort

      If the tool is unable to connect to the specified resource, a socket exception will be thrown:

      Network issue while connecting to http resource. Please reference tzupdater README.

      Automatic SHA-512 hash checks will be performed on the downloaded tzdata bundle for integrity verification. If the SHA-512 hash value does not match expectations, the tool will exit.

Overriding the SHA-512 Hash Checks (Not Applicable for TZupdater version 2.2.0 and above)

There may be some situations where a new tzdata release is available but Oracle has not yet updated the https resource website with the new SHA-512 hash value.

In such cases, the user will see the following exception message:

 No SHA-512 hash file found: https://javadl-esd-secure.oracle.com/update/tzupdater/tzdata2014a.tar.gz.sha512. If using http(s) resource location, the file may not yet be available. Please reference tzupdater README  

The user, in such a case, has the option to use the file:// protocol with the new -l option where they can specify their own local SHA-512 hash value:

  • Download a copy of the desired tzdata.tar.gz bundle to a local directory.
  • Calculate the SHA-512 hash for that tar.gz bundle and create a one line file in the same local directory which contains that SHA-512 hash value. The file name must have ".sha512" appended to the original name of the bundle containing the tzdata rules.

    For example, if you've downloaded tzdata2014a.tar.gz to a local directory, then a file named tzdata2014a.tar.gz.sha512 must also exist in the same directory and must contain the SHA-512 hash value that corresponds to the tzdata2014a.tar.gz file.

  • Use the file:// protocol to apply the new timezone data. For example, if you downloaded tzdata2014a.tar.gz to /tmp directory and created the necessary /tmp/tzdata2014a.tar.gz.sha512 file which contains the one line sha512 hash value, the following command can be used to run the tzdata update: java -jar tzupdater.jar -l file:///tmp/tzdata2014a.tar.gz (Add the -v option for verbose output)
 

Known Restrictions

The tool has a few restrictions due to the TimeZone API and implementation constraints.

  • Timezone display names This tool will not update display names of timezones that are completely new or have display name-related changes. Full support of all timezone display names requires installation of the latest Oracle Java SE platform JDK/JRE update release.
  • Systemwide Usage You must stop any running instances of the JDK/JRE software to be operated upon before you run the TZUpdater tool on that installed JDK/JRE software image. It is possible for systems to accrete multiple copies of JDK/JRE software images, so you might need to apply the tool individually to each JDK/JRE software image. Locating multiple installed copies of the JDK/JRE software on Unix derivative systems is shown below. Microsoft Windows users can use the desktop search utility.
    • Find locally installed JDK/JRE software instances for Unix derived systems: /usr/bin/find DIRPATH -fstype nfs -prune -o -fstype autofs -prune -o -name java -print -exec {} -version \; Where DIRPATH is a directory path to search under for installed instances of the Java SE platform, for example, /usr .
    • Automate updating of locally installed instances:
    • 
       /usr/bin/find DIRPATH -fstype nfs -prune -o -fstype autofs -prune -o -name java -print -exec {} -jar / ABSOLUTEPATH/tzupdater.jar -l \;  
      

      Where DIRPATH is a directory path to search under for installed instances of the Java SE platform, for example, /usr . ABSOLUTEPATH should be replaced with the full path name to the directory into which tzupdater.jar is expanded.

  • Restrictive umask settings on Solaris The TZUpdater tool creates files with default file permissions. On the Solaris operating system, this is taken from the umask . A default umask of 022 should be used for running the TZudpater tool. A more restrictive umask such as umask 077 will mean files created by the tool are unreadable by other users.

Known Issues

tzdata2024b

The following is a known issue when processing tzdata2024b:

The 2024b update has a change that uses "April" instead of the abbreviation ("Apr"), which causes the TZUpdater tool to fail in its month-parsing logic.

The issue is being tracked under:

https://bugs.openjdk.org/browse/JDK-8339645

Perform the following workaround to address this issue:

  1. Download the tzdata2024b bundle from the following location:
    https://data.iana.org/time-zones/releases/tzdata2024b.tar.gz
  2. Extract the contents of tzdata2024b.tar.gz to a local directory.
  3. Open the northamerica file in a text editor and modify the rule entry on line number 2634 in the IN column from April to Apr as specified in the following patch in IANA:

    https://github.com/eggert/tz/commit/926b507fa5c3192b1b68fab5910cbd3ba9377c97

  4. Compress and package the modified tzdata2024b bundle. For example, the following command compresses and packages the modified bundle in a file named tzdata_modified.tar.gz:
    tar -czvf <directory in which to create the modified bundle>/tzdata_modified.tar.gz *
  5. Run the TZUpdater tool and specify the modified bundle path in the -l option. For example:
    java -jar tzupdater.jar -l file://<directory that contains the modified bundle>/tzdata_modified.tar.gz

tzdata2020a

The following is a known issue when processing tzdata2020a:

Due to formatting changes in the IANA-maintained tzdata bundle, the TZUpdater tool fails to update to tzdata2020a for JDK 7u.

The issue is being tracked under:

https://bugs.openjdk.java.net/browse/JDK-8245950

Please refer to the bug for a temporary workaround.

System-Specific Installation Information

TZUpdater is a pure Java tool that does not address platform-specific software management issues. For example, on a Windows system, this means that the additional and backup files created by the tool will not be removed during an uninstall. To uninstall updated JRE software, check the JRE software's install directory and remove it manually once the uninstaller completes.

For Solaris systems, where the JRE software being updated exists as a Solaris package (such as in /usr/j2se or /usr/jdk/ instances), this has meant that the pkgchk command would highlight the changes as errors or inconsistencies. Starting with version 1.1.0 of TZUpdater, the tool runs an additional series of package management commands that updates the package database where appropriate.

On a Solaris 10 system where existing package-based JRE software has been updated by the initial release of TZUpdater, and zones have been created, the zones will contain the same pkgchk errors as the global zone. During zone creation, these pkgchk errors will be highlighted at the end of the zone installation command.

To resolve Solaris package database errors, take the following steps. However, if you are not running on a Solaris 10 system or your system does not have zones, only step 1 is required. If the system is a Solaris 10 system with additional zones, run step 1 only in the global zone and follow steps 2 and 3.

  • Run the current version of TZUpdater, with the -f force option to reapply the timezone update to a previously updated JRE software instance. The update will take place, and the additional package resolution commands will be executed. The update must be executed as the root user and is relevant to the global zone only in a Solaris 10 system.

  • For systems with zones, unpack the pkg_resolve.sh script from the tzupdater.jar file /bin/jar xf tzupdater.jar pkg_resolve.sh
  • In the zones where there is a package-based Java platform installation, execute the script. You must run the script as root: /bin/ksh ./pkg_resolve.sh JAVA_PATH For example: /bin/ksh ./pkg_resolve.sh /usr/jdk/instances/jdk1.8.0/bin/java

NOTE: The update to the package system removes many files from the package database and reinserts them, so it can take up to 15 minutes.

Removing TZUpdater Tool Changes

You must stop any running instances of the JDK/JRE software to be operated upon before you run the TZUpdater tool on that installed JDK/JRE software image.

There is currently no option to remove TZUpdater modifications. By following the following steps, you can manually remove the modifications made by the current TZUpdater tool.

For JDK 7 and earlier family versions:

  • Locate the 'zi' directory under the modified JAVAHOME/jre/lib directory. This is the newer data file.
  • Locate a 'zi.tzdata*' directory in the same JAVAHOME/jre/lib directory. This is the replaced, older data.
  • Obtain the currently installed timezone data version from the command java -jar tzupdater.jar -V .
  • Rename the current 'zi ' directory to something like 'zi.tzdata2016b' , or whatever version was given by the command in step 3. Ensure this does not conflict with the older data directory.
  • Rename the older data directory to 'zi' .
  • Validate the change in currently active timezone data by executing java -jar tzupdater.jar -V .
  • Restart applications on this JDK/JRE instance as desired.

For JDK 8 and later family versions:

  • Locate the 'tzdb.dat' file under the modified JAVAHOME/jre/lib directory. This is the newer data file.
  • Locate the 'tzdb.dat.<oldtzdataversion>' ; file in the same JAVAHOME/jre/lib directory. This is the replaced, older data file.
  • Obtain the currently installed timezone data version from the command java -jar tzupdater.jar -V .
  • Rename the current 'tzdb.dat' file to something like 'tzdb.dat.<newtzdataversion>' , or whatever version was given by the command in step 3. Ensure this name does not conflict with the older data files.
  • Rename the older data file to 'tzdb.dat' .
  • Validate the change in currently active timezone data by executing java -jar tzupdater.jar -V .
  • Restart applications on this JDK/JRE instance as desired.

For More Information

The following links point to information provided by Oracle Corporation relating to timezones and DST changes and how they affect the Java platform and other Oracle products:

The following external links provide general information about timezones and DST: