Меню Рубрики

Java timezone update windows

Обновление базы временных зон с помощью Java Timezone Updater Tool

Утилита Java Timezone Updater Tool предназначена для обновления базы временных зон в вашей JRE до последней версии. Программу рекомендуется использовать, если вы по каким либо причинам не можете обновить JRE до последней версии, либо если в в свежую JRE включена устаревшая база временных зон. Скачать Java Timezone Updater Tool можно на странице загрузки.

Перед запуском программы следуешь завершить все выполняющиеся Java-приложения и апплеты.

Как запустить

Возможные опции

-h, —help Вывод справки
-V, —version Вывод версии программы и версий баз временных зон в JRE и Updater Tool.
-u, —update Обновляет базу временных зон и запускает проверочные тесты.
-l, —location Компиляция, тестирование и обновление базы из указанного файла tzdata.tar.gz. Поддерживаются протоколы http://, https:// и file://, например -l http://www.iana.org/time-zones/repository/tzdata-latest.tar.gz
-f, —force Принудительно обновляет базу временных зон, даже если версия имеющейся базы более новая. Использование данной опции не требуется в нормальных условиях.
-v, —verbose Вывод более детальной информации о выполняемых действиях.
-bc, —backwardcompatible Сохраняет обратную совместимость с JDK версии 1.1 с трёхбуквенными идентификаторами временных зон «MST», «EST», and «HST». Любые идентификаторы, которые конфликтуют с JDK 1.1 будут исключены из обновления. Данный параметр может быть применим только к JRE до 7-й версии включительно.
-t, —test Запускает проверочные тесты, определяющие есть ли в JRE данные временных зон, не соответствующие данным программы.

В простейшем случае обновить базы временных зон можно следующей командой.

Если программа сталкивается с неожиданной ошибкой, например нехваткой свободного места, она пытается восстановить оригинальное состояние базы.

Обновление по требованию

В версии программы 2.0 появилась возможность обновления временных зон из исходников, для этого был добавлен параметр -l, задающий местоположения файла tzdata.tar.gz. Однако есть один нюанс, если Updater Tool загружает файл откуда нибудь из сети, то проверяет его контрольную сумму sha512, сохранённую на сайте Oracle. И если новая версия базы появилась недавно, и для неё ещё не успели загрузить на сайт файл контрольной суммы, то программа выдаст ошибку примерно следующего вида.

Чтобы решить проблему, нужно сохранить файл локально, и создать в том же каталоге файл контрольной суммы с добавлением к имени исходного файла .sha512. Например для Linux, чтобы обновление прошло наверняка можно воспользоваться такой последовательностью команд.

Источник

Timezones, Daylight Savings, and the TZupdater for the Java Runtime Environment (JRE)

By the Java SE Platform Support Team, June 2013

Contents

Timezones and Daylight Saving Time

As anyone who has traveled any significant distance or worked with colleagues abroad knows, the world is divided into many different timezones. Furthermore, as well as different countries being in one or more different timezones, some countries also apply Daylight Saving Time (DST). DST is a system of handling the changing amounts of daylight throughout the year, as the seasons change. In any given timezone, as you get further away from the equator, there are more hours of daylight per day in summer than there are in winter. So, the goal of DST is to maximize the daylight hours available during typical waking hours. By adjusting clocks forward on a specific date by a standard amount, usually one hour, people can take better advantage of daylight during their typical working day. For example, suppose you wake daily at 7:00 AM. In the spring, the sun rises earlier each day. So, instead of waking up at 6:00 AM to take advantage of the extra daylight, DST observers move their clocks ahead by one hour. The effect is that they can continue to wake at 7:00 AM according to the clock and also enjoy more daylight. In the fall, clocks are set back an hour as sunrise happens later each day.

Since DST policy is set by national and regional governments, changes in DST policy occur at different times in different countries. Some countries are currently extending their DST periods, thereby changing the dates on which DST will come into effect in a given year. Some countries do not implement any DST at all. So, regardless of where in the world you live, you should anticipate that changes in DST and timezone rules might occur at some point, and be ready to adjust clocks accordingly on the approved dates when these decisions are made. For Java technology-based applications that need to know the exact time in a given location, it is recommended to keep the Java Runtime Environment (JRE) software updated with these latest DST rules. See Timezone Data Versions in the JRE Software to see which Timezone data version is included in your version of the JRE software.

Timezone Database

In the absence of a single international body to keep track of the different timezones and the DST rules applied in each of them, the most widely used and respected body is the Timezone Database. The Timezone Database provides regular distributions of its data to reflect any recent changes in the timezone boundaries or DST rules that are applied in different countries or regions throughout the world. The computer industry uses this timezone data in programs and operating systems.

Updating the Java Runtime Environment With the Latest Timezone Data

Oracle makes every effort to ship each JRE update release with the most up-to-date timezone data possible. Including current timezone data in each update of the JRE software, however, given the unpredictability of timezone changes one could occur shortly after an update to the JRE so waiting for the next update might not be possible. Support user might also want to update earlier JRE releases that have already been installed and that are otherwise functioning adequately. The Java SE platform’s timezone data is not read from the local or host operating system (OS), so OS timezone patches will not update the JRE software’s timezone data. Consequently, JRE releases might have outdated DST rules that have been superseded by changes in timezone boundaries or DST rules that are implemented after that release. As a result, applications running on a JRE implementation in a region that has changed its DST rules might report the incorrect time after the date that the new DST rules were implemented. This can have serious consequences for software applications.

If you have installed the latest update release of Java Runtime Environment (JRE) then you probably already have the most recent version of the timezone data. However, more recent data that affects your timezone might have been released after the latest JRE update release. Consequently, if you are concerned about application failures that may result from any DST changes, you should perform the following steps:

  1. Check which version of the timezone data is included in your JRE version. See Timezone Data Versions in the JRE Software.
  2. If the latest timezone data for your region is not in your JRE implementation, then update your JRE version with the most recent update release.
  3. If the latest JRE does not have the most current TimeZone date download the latest TZUpdater tool and follow the instructions below

The TZUpdater Tool

Installing the latest JRE update release is the preferred vehicle for delivering both timezone data updates and other product improvements, such as security fixes. However, if the timezone rules in your region change and you are unable to use the latest JRE update release, then you will need to update the platform’s timezone data without altering other system configurations and dependencies. If for any reason you cannot upgrade your JRE software to the most recent update release, Oracle provides, to it’s support customers, a tool that can modify the timezone data within your existing JRE software without requiring you to update the whole platform. This tool, TZUpdater, updates installed JRE implementations with the most recent timezone data.

If the latest timezone data for your region is still not correct, then you should download and run the TZUpdater tool (Requires My Oracle Support Account).

Oracle provides TZUpdater tools for all currently supported versions of the JRE software and on all the platforms that are supported by Oracle. The tool is designed and built to provide full compatibility with any existing, previously installed JRE software on your system. For details of the latest release of the TZUpdater tool, see the TZUpdater README.

Even if you do upgrade to the latest update release of the JRE software, it is still possible that the latest timezone data for your region is not included. In this case, you should run the TZUpdater tool. See Timezone Data Versions in the JRE Software to see which version of the timezone data is included in which JRE update release.

For More Information

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

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

Источник

How to check and set Java timezone (update tzdata for openJDK) using tzupdater

How to check java timezone linux. Steps to set java timezone using tzupdater. update tzdata for openjdk rpm in RHEL or CentOS Linux. update tzdata-java rpm to update timezone for java in Linux. Check java timezone for openjdk using tzupdater in Linux. check openjdk timezone. Do I need to reboot after updating tzdata

In this article I will show you two methods to check and set java timezone (update tzdata for openJDK) with examples

Method 1: Update tzdata for openJDK using tzupdater

The first method to update tzdata for openJDK is usign TZUpdater tool. TZUpdater is a third party tool from Oracle which can be downloaded from official Oracle page .

What is TZUpdater?

The TimeZone updater tool or 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.

In RHEL or CentOS environment you will find tzdata rpm which controls the timezone applied at system level while tzdata-java controls the timezone for java oriented applications such as openJDK, JRE etc

But still for the sake of this article I will share the steps which can be used to set java timezone in RHEL/CentOS/SLES or distributions having similar source code.

Install TZUpdater

Once you have downloaded the tzupdater archive, you can extract it under any location on your Linux host using the steps as shown below:

Check Java TimeZone

Before we update java timezone, we should check the existing tzdata bundle which is part of our OpenJDK rpm. Use the below syntax:

So currently my OpenJDK contains tzdata2016i which is really very old considering the latest available tzdata at the time of writing this article is 2019b.

Download tzdata archive

To update or set java timezone we must next manually download the tzdata archive . But if you just wish to use the latest available tzdata archive at IANA to update tzdata for OpenJDK then you need not download any archive. You just need an active internet connection and tzupdater tool will download the latest tzdata archive and install it in your openJDK binary.

To download different version of tzdata, you can check IANA page .

Set Java timezone using tzupdater

Now since my system is connected to internet and I wish to apply the latest available tzdata, I will just execute the below command to update or set java timezone:

Looks like there is some problem with the «asia» timezone content which is part of tzdata2019b.

How to fix Failed while parsing file ‘/tmp/tz.tmp/asia’?

This has to be fixed by the development team of tzdata but for us to proceed we can use a workaround as also worked for me. I checked some backlogs and history and turns out all the tzdata released after 2018d contains this problem for asia timezone file. So we can take the asia timezone file from tzdata 2018d and replace it in tzdata2019b

Download tzdata2018d from iana page
Extract it under a temporary location

Repeat the same steps for tzdata2019b

Next replace the asia timezone from from 2018d to 2019b

Next re-create the archive for 2019b with the latest changes

Now let us re-try to set java timezone using tzupdater tool

So our workaround worked and we are have successfully set java timezone.
Using file:///tmp/tzdata2019b.tar.gz as source for tzdata bundle.

Restart your java applications to activate the new timezone related changes

Method 2: Update tzdata for openJDK using tzdata-java

For OracleJDK in Red Hat/CentOS environment you can alternatively use tzdata-java rpm which will also internally set java timezone without any hassle.

Currently my system is running with 2018e version of tzdata rpm as you can see below:

Also if we check java version using tzupdater, my OpenJDK has 2018e version of tzdata

Next we will update tzdata rpm to 2019a by manually downloading the rpm from IANA database

And re-verify the tzdata version for OpenJDK, which remains unchanged to we know tzdata has no impact on tzdata of OracleJDk

Next we will update tzdata-java rpm to 2019a

Re-verify the tzdata for OracleJDK, as you see now our java for OpenJDK also contains tzdata2019a

Restart your java applications to activate the new timezone related changes

Lastly I hope the steps from the article to update or set java timezone (update tzdata for openJDK) using tzupdater on Linux was helpful. So, let me know your suggestions and feedback using the comment section.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • Java swing style windows
  • Java print pdf windows
  • Java library path windows
  • Java latest windows xp
  • Java installer windows offline installer