Tuesday, 8 April 2008

Updating Java JRE with Daylight Savings Patches

Recently I had to update the daylight saving data on the Java JRE due to the recently NZ daylight saving changes. Updating the daylight saving changes wasn't as hard as I thought and the process went very smooth too! : )

Here's a quick summary of my findings and what I did:
The Java SE platform uses its own private repository of timezone data. Therefore patching your OS's timezone data will not update or change your Java's timezone data.

Inside the JRE the timezone data is maintained inside the folder: jre/lib/zi.

The list of timezone data version can be found in:
http://java.sun.com/javase/timezones/tzdata_versions.html

The easiest way to do it is by using the TZUpdater available from this page:
http://java.sun.com/javase/timezones

You can first run a test on the JRE to see what version of the timezone data it is using by (where tzupdaterXYZ.jar is the name of the TZUpdater jar):
java -jar tzupdaterXYZ.jar -t
In the printout you should be able to tell the version of data it is using.

Finally, to update the timezone just run the jar without the "t" flag. Run a test again to verify that the timezone data has been updated.

Viola your JRE timezone is now patched! Easy as that! : )

Reference:
http://java.sun.com/javase/timezones/DST_faq.html#tzupdater
http://java.sun.com/javase/timezones/

1 comment:

  1. Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the TĂȘnis e Sapato, I hope you enjoy. The address is http://tenis-e-sapato.blogspot.com. A hug.

    ReplyDelete