This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-02
Channels
- # announcements (26)
- # architecture (29)
- # babashka (8)
- # beginners (91)
- # calva (70)
- # cider (7)
- # circleci (2)
- # cljs-dev (1)
- # clojure (79)
- # clojure-australia (2)
- # clojure-dev (3)
- # clojure-europe (40)
- # clojure-italy (2)
- # clojure-losangeles (4)
- # clojure-nl (4)
- # clojure-uk (4)
- # clojurescript (34)
- # cursive (13)
- # datomic (16)
- # defnpodcast (2)
- # emacs (11)
- # events (1)
- # fulcro (13)
- # graalvm (17)
- # gratitude (3)
- # instaparse (10)
- # introduce-yourself (2)
- # jobs (1)
- # jobs-discuss (5)
- # juxt (3)
- # kaocha (5)
- # meander (5)
- # membrane (2)
- # nextjournal (43)
- # off-topic (42)
- # pathom (52)
- # pedestal (8)
- # portal (3)
- # rdf (2)
- # re-frame (10)
- # reveal (21)
- # shadow-cljs (56)
- # slack-help (7)
- # vim (33)
- # xtdb (43)
hey
I’m new to building native-images, we are just experiencing with it at work. A quick q: has anyone had to compile joda-time
into a native-image? And if so how could you make it work?
the latest error I’m getting:
Error: Class initialization of org.joda.time.UTCDateTimeZone failed.
Caused by: java.lang.NullPointerException: Cannot invoke "String.hashCode()" because the return value of "org.joda.time.UTCDateTimeZone.getID()" is null
Probably some code that runs on toplevel which doesn't work good with graalvm, maybe you can delay the class initialization to runtime?
yeah, a static class: https://github.com/JodaOrg/joda-time/blob/master/src/main/java/org/joda/time/UTCDateTimeZone.java#L26
You should really be using #clj-easy graal-build-time which will only initialize clojure code at build time
absolutely agree about java.time, but unfortunately we have some legacy code which uses joda-time
and this project is a POC for using native-image so getting rid of joda-time is not in the scope
Not sure this is helpful, but I had exactly this problem, spent a whole lot of time trying different things to resolve, and in the end, gave up and migrated to java.time.