This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-26
Channels
- # announcements (18)
- # aws (17)
- # babashka (19)
- # beginners (141)
- # calva (73)
- # cider (4)
- # clj-kondo (13)
- # cljs-dev (2)
- # clojure (97)
- # clojure-europe (6)
- # clojure-italy (5)
- # clojure-nl (1)
- # clojure-spec (25)
- # clojure-sweden (2)
- # clojure-uk (25)
- # clojured (3)
- # clojurescript (63)
- # core-typed (6)
- # cursive (23)
- # data-science (4)
- # datomic (74)
- # fulcro (19)
- # graalvm (18)
- # graphql (3)
- # hoplon (63)
- # jackdaw (1)
- # juxt (23)
- # london-clojurians (3)
- # meander (7)
- # off-topic (23)
- # om (1)
- # pathom (13)
- # pedestal (2)
- # perun (2)
- # re-frame (38)
- # reagent (3)
- # reitit (24)
- # shadow-cljs (91)
- # spacemacs (14)
- # sql (4)
- # tools-deps (8)
- # vim (3)
Hi there. I'm trying to compile simple code with lein native-image which is using com.jcraft.jsch.JSch and got following error
Error: No instances of .Inet4Address are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use -H:+TraceClassInitialization.
Detailed message:
Trace: Object was reached by
reading field com.jcraft.jsch.PortWatcher.anyLocalAddress
How can I prevent this? I tried --initialize-at-run-time with anyLocalAddress but it didn't help. Maybe someone compiled Jsch before? The code looks like this
(ns binssh.core
(:import (com.jcraft.jsch JSch))
(:gen-class))
(defn -main
[& args]
(let [[user host keyname & other] args
ssh (JSch.)
port 22]
(let [sess (.getSession ssh user host port)]
(.setPortForwardingL sess 8842 "localhost" 8888)
(.connect sess))))
@romantsopin which graalvm version are you using?
@romantsopin I think this project might be using JSch: https://github.com/epiccastle/spire - maybe you can look at that
I took option --initialize-at-run-time=com.jcraft.jsch.PortWatcher from epiccastle/spire and seems like it's working
Also maybe you have a good reference which explains all this flags in detail and how do exactly they work?
we have some docs here: https://github.com/lread/clj-graal-docs welcome to contribute if you have anything to add!
👍 4