Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to and GraalVM slack:
borkdude 2020-02-26T15:46:03.044Z


alexmiller 2020-02-26T15:49:38.044600Z

feel the tingle in the air?


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))

(defn -main
  [&amp; args]
  (let [[user host keyname &amp; other] args
        ssh (JSch.)
        port 22]
    (let [sess (.getSession ssh user host port)]
      (.setPortForwardingL sess 8842 "localhost" 8888)
      (.connect sess))))

borkdude 2020-02-26T18:41:26.048200Z

@romantsopin which graalvm version are you using?

borkdude 2020-02-26T18:42:32.048600Z

@romantsopin I think this project might be using JSch: - maybe you can look at that


GraalVM CE 20.0.0

borkdude 2020-02-26T18:44:05.049600Z

which java version, 8 or 11?


it's 13. This may cause problems?

borkdude 2020-02-26T18:45:40.050800Z

13 is not a java version that graal supports, it's either 8 or 11

borkdude 2020-02-26T18:45:58.051100Z

anyway, try with 19.3.1-java8


Will do, thank you!

borkdude 2020-02-26T18:46:41.052100Z

also, take care that you don't get reflection, so put *warn-on-reflection* to true


I took option --initialize-at-run-time=com.jcraft.jsch.PortWatcher from epiccastle/spire and seems like it's working


this is awesome, thanks @borkdude!


Also maybe you have a good reference which explains all this flags in detail and how do exactly they work?

borkdude 2020-02-26T18:50:37.055100Z

we have some docs here: welcome to contribute if you have anything to add!

zilti 2020-02-26T20:20:20.055900Z

borkdude, any reason why java8 instead of java11?

borkdude 2020-02-26T20:22:39.056900Z

@zilti I've had some issues with jdk11, so in case of problems it's good to see if java8 behaves differently