Exception while trying to compile JODA time 2.1 source

我是研究僧i 提交于 2019-12-11 11:35:33

问题


I need to support SystemV time zones in Joda time.So as mentioned in this so answer,i tried recompiling after commenting the lines in SystemV data file.But while compiling it gives this exception :

 [java] Exception in thread "main" org.joda.time.IllegalFieldValueException: Value 292278995 for year must be in the range [-292275054,292278993]
     [java]     at org.joda.time.field.FieldUtils.verifyValueBounds(FieldUtils.java:217)
     [java]     at org.joda.time.chrono.BasicYearDateTimeField.set(BasicYearDateTimeField.java:82)
     [java]     at org.joda.time.chrono.BasicYearDateTimeField.add(BasicYearDateTimeField.java:63)
     [java]     at org.joda.time.tz.DateTimeZoneBuilder$OfYear.next(DateTimeZoneBuilder.java:575)
     [java]     at org.joda.time.tz.DateTimeZoneBuilder$Recurrence.next(DateTimeZoneBuilder.java:761)
     [java]     at org.joda.time.tz.DateTimeZoneBuilder$Rule.next(DateTimeZoneBuilder.java:863)
     [java]     at org.joda.time.tz.DateTimeZoneBuilder$RuleSet.nextTransition(DateTimeZoneBuilder.java:1091)
     [java]     at org.joda.time.tz.DateTimeZoneBuilder$RuleSet.firstTransition(DateTimeZoneBuilder.java:1029)
     [java]     at org.joda.time.tz.DateTimeZoneBuilder.toDateTimeZone(DateTimeZoneBuilder.java:351)
     [java]     at org.joda.time.tz.ZoneInfoCompiler.compile(ZoneInfoCompiler.java:391)
     [java]     at org.joda.time.tz.ZoneInfoCompiler.main(ZoneInfoCompiler.java:136)

Any idea what this is ?


回答1:


Look to the joda-time-2.1.jar/META-INF/MANIFEST.MF we can see that requared JDK is
Build-Jdk: 1.5.0_22.
So use it, instead if you.

You have bad zoneinfo files. I build joda lib without any problems, using JDK 1.6_22.

At building process we have next

main:
    [mkdir] Created dir: D:\js\target\classes\org\joda\time\tz\data
     [java] Writing zoneinfo files
     [java] Writing ZoneInfoMap
Executed tasks  

here your building fails



来源:https://stackoverflow.com/questions/12606502/exception-while-trying-to-compile-joda-time-2-1-source

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!