JDK-8203908 : TZUpdater tool fails to print version info for the users without write persmisson
  • Type: Bug
  • Component: tools
  • Sub-Component: updaters
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-05-29
  • Updated: 2018-08-10
  • Resolved: 2018-05-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
2.2.0 b01Fixed
Description
Users without write permission have seen the AccessDeniedException while executing the -V (--version) command of the TZUpdater tool.
The exception on windows looks like this:
java -jar tzupdater.jar -V
tzupdater version 2.2.0-b01
JRE tzdata version: tzdata2018c
Failed: java.nio.file.AccessDeniedException: C:\Java\testTZUpdater\jdk1.8.0_171\jre\lib\tzdb.dat.dynamic
java.nio.file.AccessDeniedException: C:\Java\testTZUpdater\jdk1.8.0_171\jre\lib\tzdb.dat.dynamic
        at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
        at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230)
        at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434)
        at java.nio.file.Files.newOutputStream(Files.java:216)
        at tools.tzdb.TzdbZoneRulesCompiler.outputFile(TzdbZoneRulesCompiler.java:228)
        at tools.tzdb.TzdbZoneRulesCompiler.compile(TzdbZoneRulesCompiler.java:201)
        at tools.tzdb.TzdbZoneRulesCompiler.<init>(TzdbZoneRulesCompiler.java:310)
        at com.sun.tools.tzupdater.ExternalModule.compileToJSRBinary(ExternalModule.java:176)
        at com.sun.tools.tzupdater.TimezoneUpdater.run(TimezoneUpdater.java:240)
        at com.sun.tools.tzupdater.TimezoneUpdater.main(TimezoneUpdater.java:636)

Comments
The main issue here is, for -V command tzupdater creates a file named tzdb.data.dynamic under .../jre/lib directory, and when next time any user with read only permission tries to use the same command, the tool is unable to override the existing tzdb.data.dynamic file and hence the AccessDeniedException is thrown for such users.
29-05-2018