Hi, can anyone tell me why does this exception occur when running a Oracle-GraalVM-25.0.1 native-compiled binary?
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.base@25.0.1/java.lang.invoke.DirectMethodHandle.ensureInitialized(DirectMethodHandle.java:334)
at java.base@25.0.1/java.lang.invoke.DirectMethodHandle.internalMemberNameEnsureInit(DirectMethodHandle.java:335)
Caused by: java.io.FileNotFoundException: Could not locate clojure/core/server__init.class, clojure/core/server.clj or clojure/core/server.cljc on classpath.
at clojure.lang.RT.load(RT.java:482)
at clojure.lang.RT.load(RT.java:444)
at clojure.core$load$fn__6933.invoke(core.clj:6189)
...
I just did a lein new app foo (uses Clojure 1.12.2) and added the snippet from here https://github.com/clj-easy/graalvm-clojure/blob/master/sample-project/project.clj#L11-L29 into project.clj. The native binary builds fine, but emits the stack trace ^ when run.@borkdude Thank you!
You need to use initialize at build time. See clj-easy graal build time