14

How do I update the timezone information for the OpenJDK? Oracle puts out tzupdater but that is bound by their license so I don't want to use it. I'm looking for an open source alternative that will allow me to just update the timezone information and not the entire JRE.

MonkBen
  • 546
  • 5
  • 21

1 Answers1

15

Azul recently published an open source tool to update TZ data: https://www.azul.com/products/open-source-tools/ziupdater-time-zone-tool/

It works similar to Oracle tzupdater, but has open source (GPLv2 License) license.

Usage: apply it to IANA data package using Java which you want to update:

$JAVA_HOME/bin/java -jar ziupdater.jar -l file://[path]/tzdata.tar.gz

By this command you will apply changes to timezone to your Java installation.


What does it mean?

Consider next situation: you installed Java a year ago and later a government of certain country changed their laws, e.g. cancelled DST. Your Java installation doesn't know about that yet and may handle time incorrectly for that particular region. Updating timezone data solves that.

Sergey Grinev
  • 34,078
  • 10
  • 128
  • 141
  • 3
    Great information. But I suggest replacing that word “locale”. I understand what you mean, but it could be confused with [`Locale`](https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html) which has *nothing* to do with time zone, completely orthogonal, yet is involved in date-time work because of localizing the textual `String` representations of date-time values. Conflating time zone and locale is a common source of confusion among programmers learning to do date-time work. I suggest replacing “for the locale of that particular country” with something like “for a particular region”. – Basil Bourque Jun 27 '17 at 05:22
  • 1
    That is great. Exactly what I was looking for. – MonkBen Jun 27 '17 at 14:15
  • @muyinliu please, send a request to azul_openjdk@azul.com – Sergey Grinev Jun 05 '19 at 19:42
  • https://github.com/akashche/tzdbgen is fork of part of OpenJDK https://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/make/src/classes/build/tools/tzdb/ – muyinliu Jun 07 '19 at 05:49