We have a simple utility app that reads all the time zone data used in a JRE and displays it all in a simple table. We need to use an older version of the JRE (6_24) for an upcoming product release (due to other issues apparently), but we also need to include newer time zone updates in that release (that would otherwise be included in, say, 6_29). We’re already packaging a private JRE that will be installed, so getting the time zone updates into that private JRE using the TZUpdater tool is not the issue – The issue is reading/verifying which version of the tzdata (e.g. tzdata2010o, tzdata2011k) is being read with the utility app (i.e. which version is being used in the JRE the app is running in). The app currently displays the JRE version in the title bar, but with the time zone updates, that’s no longer sufficient to determine which time zone data version is in use.
I’ve looked into the TimeZone class, but it doesn’t seem to provide this information – perhaps there is a system property that holds this info? The TZUpdater tool knows which version is being used, so it must be available somewhere – I can’t imagine they would analytically determine which version is in use in the update tool… Anybody know where to locate this info?
In one of my JREs, there’s a file in
JRE_PATH\lib\zinamedZoneInfoMappings. In the first line it displays the data you are looking for.I’m going to search for a less hackish way, will update answer if I find something.
UPDATE:
Seems that there’s no API to get this data. However, the code in the class
sun.util.calendar.ZoneInfoFileshows how to parse it.