Java Daylight Saving Time

-1

We made the change to the 2018 daylight saving time entry in the Operating System (Linux or Windows), but the JAVA application shows the wrong time (with daylight saving time).

    
asked by anonymous 23.10.2018 / 18:20

1 answer

3

We found that JAVA has its own Daylight Saving Time (DST) and that it is necessary to update the configuration due to the default change.

JAVA ORACLE or OPENJDK

  • Download latest version of TZDATA
  • Download the TZUpdater Tool
  • Run the command below (specify the full path)

    export JAVA_HOME=caminho do java
    java -jar tzupdater.jar -f -l file:///home/USER/Downloads/tzdata-latest.tar.gz
    
  • If the error occurs, simply unzip the tzdata file, comment the file line and recompress TZDATA

    .

    Using file:///home/USER/Downloads/tzdata-latest.tar.gz as source for tzdata bundle.
    Failed: java.lang.Exception: Failed while parsing file '/tmp/tz.tmp_6/asia' on line 1655 'Rule  Japan   1948    1951    -   Sep Sat>=8  25:00   0   S'
    java.lang.Exception: Failed while parsing file '/tmp/tz.tmp_6/asia' on line 1655 'Rule  Japan   1948    1951    -   Sep Sat>=8  25:00   0   S'
        at tools.tzdb.TzdbZoneRulesCompiler.parseFile(TzdbZoneRulesCompiler.java:377)
        at tools.tzdb.TzdbZoneRulesCompiler.compile(TzdbZoneRulesCompiler.java:191)
        at tools.tzdb.TzdbZoneRulesCompiler.<init>(TzdbZoneRulesCompiler.java:307)
        at com.sun.tools.tzupdater.ExternalModule.compileToJSRBinary(ExternalModule.java:153)
        at com.sun.tools.tzupdater.TimezoneUpdater.run(TimezoneUpdater.java:230)
        at com.sun.tools.tzupdater.TimezoneUpdater.main(TimezoneUpdater.java:634)
    Caused by: tools.tzdb.DateTimeException: Invalid value for SecondOfDay value: 90000
        at tools.tzdb.ChronoField.checkValidValue(ChronoField.java:173)
        at tools.tzdb.LocalTime.ofSecondOfDay(LocalTime.java:210)
        at tools.tzdb.TzdbZoneRulesCompiler.parseMonthDayTime(TzdbZoneRulesCompiler.java:475)
        at tools.tzdb.TzdbZoneRulesCompiler.parseRuleLine(TzdbZoneRulesCompiler.java:399)
        at tools.tzdb.TzdbZoneRulesCompiler.parseFile(TzdbZoneRulesCompiler.java:354)
        ... 5 more
    
  • Standard output

    java -jar tzupdater.jar -f -l file:///home/USER/Downloads/tzupdater-2.2.0/tzdata/tzdata.tar.gz 
    
    Using file:///home/USER/Downloads/tzupdater-2.2.0/tzdata/tzdata.tar.gz as source for tzdata bundle. 
    
  • IBM JAVA

  • Perform the IBM Time Zone Update Utility

    li>
  • Create directory /tmp/jtzu , copy file to folder and decompress file

    mkdir /tmp/jtzu
    cd /tmp/jtzu
    scp jtzu-1.7.18e.zip /tmp/jtzu
    unzip jtzu-1.7.18e.zip
    
  • Change the runjtzuenv.sh file by setting NOGUI to disable the graphical interface

    NOGUI=true
    
  • Run the file to perform discovery of the JVMs

    bash runjtzu.sh
    
  • The above command generates the SDKList.txt file with all Java installations found.

  • Change the file runjtzuenv.sh

    NOGUI=true
    DISCOVERONLY=false
    SILENTPATCH=false
    
  • Run the file again

    bash runjtzu.sh
    
  • 23.10.2018 / 18:36