Documentation Contents
Java Platform, Standard Edition Troubleshooting Guide
Contents    Previous    Next

8.1 Native Time Zone Information and the JRE

The JRE reads the native time zone information to determine your default time zone. For example, on Windows, the JRE queries the registry to determine the default time zone.

However, the JRE also maintains its own time zone database. This provides cross-platform support because the different operating system APIs are not sufficient to support the Java APIs. The Java time zone database supports time zone IDs and determines daylight saving time rules for all the time zones that the JRE supports. The Java time zone database can be found in <install_dir>/jre/lib/zi. The tzupdater tool is available to update the Java time zone database.

Modifications to the JRE for each specific operating system are necessary so that the operating system can deliver the system time to the JRE. Then, if a Java application requests the system date by calling date and time related constructors, the system time is returned.

Examples of such constructors are:


java.util.Date()
java.util.GregorianCalendar()

Constructors related to date and time include:


System.currentTimeMillis()
System.nanoTime()

Operating system-specific patches might be required to ensure that the correct system time is delivered to the JRE.

The following sections describe troubleshooting techniques for time zone settings.

8.1.1 Determine the Time Zone Data Version in Use

The time zone database version that ships in any JRE from Oracle is documented in the Release Notes. However, the actual version can be different from the version mentioned there if the JRE has been patched using the tzupdater tool.

To determine the current time zone data version of your JRE either run the tzupdater tool with the Version option, or examine the header of the ZoneInfoMappings file.

Follow these two steps to determine the time zone data:

8.1.2 Troubleshoot Problems with TZupdater

Sometimes when you run tzupdater it quits with the message: There's no tzdata available for this Java runtime. Example 8-4 shows two examples.

The likely cause is that you are using a JRE that is not from Oracle. Oracle provides the JRE for Oracle Solaris (x86, x64, SPARC), Linux (x86, x64, ARM), Microsoft Windows (x86, x64), and Mac OS X (x64). The java.vendor property value for these is Sun Microsystems Inc., Oracle Corporation or BEA Systems, Inc. Oracle does not provide the JRE for other platforms.

The output of running the java -version command does not provide enough information to determine the actual vendor of a JRE. However, running tzupdater in update mode with the -v option does print out the java.vendor property. Example 8-5 shows attempting to run tzupdater when the environment is HP_UX from Hewlett Packard.

In Example 8-5, java.vendor is set to Hewlett-Packard Co. The JRE that you are trying to update using tzupdater is not supported by Oracle.

A possible solution is visit the website of your JRE vendor and determine whether a time zone updater tool is available. For example, see the Hewlett-Packard version of tzupdater tool.

Contents    Previous    Next

Oracle and/or its affiliates Copyright © 1993, 2022, Oracle and/or its affiliates. All rights reserved.
Contact Us