Timezone Updater Tool


By the Java SE Platform Support Team, December 2016
Contents


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 Oracle JDK and JRE, on all supported platforms.The java.vendor property value must be Sun Microsystems Inc. or Oracle Corporation or BEA Systems,Inc.

If you have already run a previous version of the TZUpdater tool on your JDK/JRE software, you do not need to apply this version of the tool, unless your system requires the specific bug fixes described in Timezone Data Versions in the JRE Software.

Download

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

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

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 priviledges 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, tzdata version that 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 http://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 http://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.

 
Tool Updates
  • 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

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.
     
    1. 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.
       
    2. 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

The following issue is known to exist when processing tzdata2016g:

  • Version issue in tzdata 2016g release

    Due to formatting changes in the IANA-maintained tzdata bundle, the TZUpdater tool fails to determine the tzdata version when parsing the tzdata2016g.tar.gz resource bundle.  The issue has been resolved for later tzdata versions.

    If you must update your JRE/JDK installations to the tzdata2016g level use the following workaround:

    1. Download the 2016g tzdata.tar.gz file from https://www.iana.org/time-zones/repository/releases/tzdata2016g.tar.gz

    2. Extract the files to a local directory and modify the VERSION setting in Makefile:

      1. Search for the following statement:
        VERSION= unknown
      2. Change the value to 2016g as shown:
        VERSION= 2016g
    3. Recreate the tzdata2016g.tar.gz file:

      1. Use the tar command to create a tar file of the contents of the directory and name the file tzdata2016g.tar.

      2. Use the gzip command to create a tar gzip bundle from the tzdata2016g.tar file and name the file tzdata2016g.tar.gz.

    4. Create a corresponding SHA-512 checksum file in the same directory that is hosting the new .gz file. The checksum file must contain the SHA-512 hash calculated from the gz file contents.

      For information about creating the sha512 file, see Overriding the SHA-512 Hash Checks.

    5. Run the TZUpdater tool with the -l URL-resource option where URL-resource is the location of the newly created tzdata2016g.tar.gz file, for example:

      JDK_HOME/bin/java -jar tzupdater.jar -l file:///tmp/tzdata/tzdata2016g.tar.gz
 
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.

  1. 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.

  2. For systems with zones, unpack the pkg_resolve.sh script from the tzupdater.jar file :
    /bin/jar xf tzupdater.jar pkg_resolve.sh
    
     
  3. 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: