Usage of tzdata and tzdata-java rpm

1.7k Views Asked by At

As per Google, tzdata rpm controls the timezone applied at system level while tzdata-java controls the timezone for java oriented applications such as openJDK, JRE.

My confusion is.. Why java applications do not use system level related data that is system level timezone. Why does it need a separate rpm tzdata-java to update the timezone?

1

There are 1 best solutions below

0
On

Java runs on a multitude of operating systems, not all of which include the tzdata that are in the rpm package for Linux. So it seems they wanted to have one solution that worked for all Java installations rather than one for operating systems that include the data and a different one for systems that don’t.

I don’t know whether all operating systems include a default time zone. It seems they figured that many operating systems do furnish a default time zone, so it makes sense to take the JVM’s default time zone from the operating system in the cases where there is one to take. Except that you may also start a JVM with a different default time zone if you want, setting the user.timezone system property from the command line. I can add that since not all operating systems have identical concepts of a time zone, sometimes some translation is needed on some systems. I have seen at least one Stack Overflow question where the JVM’s default time zone didn’t agree with what the questioner had expected from the operating system default time zone.