Package: sun-java5-jre
Version: 1.5.0-10-3
Severity: important
*** Please type your report below this line ***

The default system timezone is detected incorrectly under Etch. The
system is configured for "US/Pacific", however Java reports
"SystemV/PST8PDT". The latter timezone doesn't have the correct DST
settings in Java, so incorrect time is displayed.

Steps to reproduce:
- Configure the system timezone to US/Pacific

- In Java execute:
 System.out.println( java.util.TimeZone.getDefault().getDisplayName() );
It will show "SystemV/PST8PDT"

- In Java execute "System.out.println( new java.util.Date() );". It
currently prints the incorrect time. It will probably start printing
correctly again soon, when we enter the old (pre-2007) DST period.

I noticed that /etc/localtime is no longer a link in Etch. I changed
it back to a symbolic link to "/usr/share/zoneinfo/US/Pacific" and
Java started working correctly again.

My conclusion is that Sun JVM relies on the _path and name of the zone
file_ to determine the zoneID (which it then matches to its own
timezone database). However since in Etch the file is no longer a
link, so they must be comparing it binary  against all files under
"/usr/share/zoneinfo".

"/usr/share/zoneinfo/SystemV/PST8PDT" is the same file binary as
""/usr/share/zoneinfo/US/Pacific", however it is found first !

To confirm this I restored "/etc/localtime" to its non-link state, and
deleted all directories under "/usr/share/zoneinfo" except "US". Voila
! Java worked again.

I am not sure what the proper fix is. Obviously we cannot fix the Java
library until they finally release it under GPL (which they are not
planning for 1.5). I don't know why /etc/locatime was changed to
non-link, but it doesn't make a lot of sense to file this as a bug
under libc or tzdata.

At least the workarounds should be documented:
- Set the TZ environment variable (but it can't be done globally)
- Use "-Duser.timezone=xxx"

Lastly, Sun may fix this. I will try reporting it there as well.

This problem Java software semi-unusable under Etch without
modifications, so I think it merits important severity, if not higher.

-- System Information:
Debian Release: 4.0
 APT prefers testing
 APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to