I'm struggling to understand what I'm doing wrong, does this error look familiar to anyone?
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:291)
at clojure.lang.Namespace.<init>(Namespace.java:34)
at clojure.lang.Namespace.findOrCreate(Namespace.java:176)
at clojure.lang.Var.internPrivate(Var.java:156)
at dominic.httpkit.<clinit>(Unknown Source)
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:351)
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:271)
Caused by: java.io.FileNotFoundException: Could not locate clojure/core__init.class, clojure/core.clj or clojure/core.cljc on classpath.
at clojure.lang.RT.load(RT.java:462)
at clojure.lang.RT.load(RT.java:424)
at clojure.lang.RT.<clinit>(RT.java:338)
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:351)
at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:271)
... 6 more
dominic.httpkit is tiny & simple❯ cat src/dominic/httpkit.clj
(ns dominic.httpkit
(:gen-class)
(:require [org.httpkit.server :refer :all]))
(defn app [req]
{:status 200
:headers {"Content-Type" "text/html"}
:body "hello HTTP!"})
(defn -main [& args]
(run-server app {:port 8080})
@(promise))
I'm using clj -Spath
for the -cp
to native-image, so I would assume that clojure files should be included?
maybe best to throw this up into a git repo
OK, I have got it by fixing an "unrelated issue". Seems to have been caused by the lack of log4j on my classpath... weird!
There's a hello world project in https://github.com/lread/clj-graal-docs