Friday Nov 23, 2007
Friday Nov 23, 2007
As timezone support in the JRE seems to have become a more sensitive topic in recent years - more and more people want to have the latest timezone data incorporated into their environment in real time. Sun released the tzupdater tool to address such issues. Unfortunately with some timezones changes being taken at very short notice, even this effort is not enough for some java users.
Here's a quick guide (as promised) on how you can incorporate the latest timezone changes into your JRE :
For those of you new to compiling a JDK 7 workspace - here's what you need (paper and scissors are optional)
fireball $pwd /space/sean/JDK7/openjdk/jdk/make/sun/javazic/tzdata fireball $cp -r ~/tzdata2007i/* .
Don't forget to change the tzdata version number :
fireball $tail -1 VERSION tzdata2007i
All set for a compilation of these new tzdata files next :
fireball $pwd /space/sean/JDK7/openjdk/jdk/make/sun/javazic/tzdata fireball $gnumake clean rm -f ../../../build/solaris-sparc/tmp/sun/sun.javazic/strip_prop_options rm -f ../../../build/solaris-sparc/tmp/sun/sun.javazic/compile_prop_options rm -f ../../../build/solaris-sparc/tmp/sun/sun.javazic/.classes.list rm -f -r ../../../build/solaris-sparc/tmp/sun/sun.javazic/obj rm -f -r ../../../build/solaris-sparc/tmp/sun/sun.javazic/obj_* rm -f -r ../../../build/solaris-sparc/classes/sun/javazic rm -f ../../../build/solaris-sparc/tmp/sun/sun.javazic/.classes.list rm -f -r ../../../build/solaris-sparc/tmp/sun/sun.javazic ../../../build/solaris-sparc/lib/ziEt VoilĂ ! - a new directory full of the latest timezone rules ready for deployment. The new files will work with JDK 7 or earlier JRE releases. - Just replace the jre/lib/zi directory with the newly created one from your workspace. You should ensure that any instance of the JRE being updated is shut down first - otherwise the risk of the JRE continuing to hold references to older timezone data exists.
fireball $gnumake all rm -f -r ../../../build/solaris-sparc/tmp/sun/sun.javazic/zi /usr/bin/mkdir -p ../../../build/solaris-sparc/tmp/sun/sun.javazic/zi rm -f ../../../build/solaris-sparc/tmp/sun/sun.javazic/zi/ZoneInfoMappings /space/sean/jdk/jdk1.6.0_03//bin/java -client -Xmx896m -Xms128m -XX:PermSize=32m
-XX:MaxPermSize=160m -jar ../../../build/solaris-sparc/btjars/javazic.jar -V "`/usr/bin/grep '^tzdata'
./tzdata/VERSION`" -d../../../build/solaris-sparc/tmp/sun/sun.javazic/zi ./tzdata/africa ./tzdata/antarctica
./tzdata/asia ./tzdata/australasia ./tzdata/europe ./tzdata/northamerica ./tzdata/pacificnew
./tzdata/southamerica ./tzdata/backward ./tzdata/etcetera ./tzdata/solar87
./tzdata/solar88 ./tzdata/solar89 ./tzdata/systemv ./tzdata_jdk/gmt ./tzdata_jdk/jdk11_backward rm -f -r ../../../build/solaris-sparc/lib/zi /usr/bin/mkdir -p ../../../build/solaris-sparc/lib/zi rm -f ../../../build/solaris-sparc/lib/zi/ZoneInfoMappings /usr/bin/cp -r ../../../build/solaris-sparc/tmp/sun/sun.javazic/zi/* ../../../build/solaris-sparc/lib/zi
Thanks for the excellent information on changing the DST in JRE.
We are trying to simulate the DST in our test environment.
As part of this process, we want to modify the rules so that the short day and long day can be any day we choose.
Currently, we chose lastSun of Feb as short day and lastSun of March as long day.
Can you please provide us an example as to what needs to be changed in the "northamerica" file?
We have changed the following in "northamerica" file:
----------------------------
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule US 2007 max - Feb lastSun 2:00 0:00 D
Rule US 2007 max - Mar lastSun 2:00 0 S
---------------------------------------
Is there any other place we need to change in "northamerica" file?
This northamerica file is from the tzdata version "tzdata2007k"
The problem with this change is that one hour is being added to every hour subsequent to last Sunday in Feb until the actual Short day (March 9).
After March 9, one hour is substracted from wall time from every hour until the actual Long Day (Nov 2).
Are there any known bugs/fixes to "javazic" code?
Your help will be very much appreciated.
Best Regards,
Praveen
Posted by Praveen Patle on January 18, 2008 at 12:36 AM GMT #
Hi Praveen,
You should be able to implement any rules that you want. The javazic tool is pretty robust with reading zic rules.
You have an error in the changes that you made. For you daylight savings you've specified 0:00 as the number of hours to save. This will have no effect.
the following should work.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule US 2007 max - Feb lastSun 2:00 1:00 D
Rule US 2007 max - Mar lastSun 2:00 0 S
Sean.
Posted by coffeys on January 28, 2008 at 03:14 PM GMT #