Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to and GraalVM slack:

I'm trying to native compile the following:

  (:require [clj-http.client :as client]))

(defn -main [& args]
    (:body (client/request
             {:method :get
              :url    "<>"}))))
And here's my build script:
clj -A:uberjar

/Library/Java/JavaVirtualMachines/graalvm-ce-java11-19.3.2/Contents/Home/bin/native-image \
 -H:+ReportUnsupportedElementsAtRuntime \
 -H:ReflectionConfigurationFiles=reflectConfig.json \
 -H:+ReportExceptionStackTraces \
 -H:+TraceClassInitialization \
 -jar ./target/foo-1.0.0-SNAPSHOT-standalone.jar \
I've tried two paths with the following issues: 1. The above. When I run the output I get <|>.FileNotFoundException: Could not locate clojure/core__init.class, clojure/core.clj or clojure/core.cljc on classpath.. 2. I've added the --initialize-at-build-time flag. When I do this I get a bunch of build errors along the lines of "Error: No instances of". However, the image does build. Any tips on a happy path here?

borkdude 2020-05-13T19:52:55.251600Z

@markbastian clj-http is known not to work with GraalVM. clj-http-lite is


Cool, I'll try that. Do you recommend ce version 20 or 19?

borkdude 2020-05-13T19:55:00.253700Z

@markbastian for SSL you must add some flags:

borkdude 2020-05-13T19:55:33.254500Z

I'm using 19.3.1 myself because it's LTS, more stable

borkdude 2020-05-13T19:56:34.255200Z

@markbastian also take a look at which essentially wraps clj-http-lite in a graal binary

borkdude 2020-05-13T19:57:03.255700Z

@markbastian there's also this even lighter curl wrapper:


Cool, thanks! I'll check those out.