I'm trying to find my way into ClojureScript, currently following the modern clojurescript tutorial using boot as my build tool. Unfortunately I keep running into a Java ClassNotFoundException concerning javax.xml.bind.DatatypeConverter
. Googling only reveals a known problem with the switch from Java 8 to 9. I'm running openJDK 11.0.4 however, so that's hardly my case.
Here's what happened so far. Initially I had no luck compiling Clojurescript at all. I would get:
java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
clojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter, compiling:(cljs/closure.clj:1:1)
I was able to get around that problem by specifying the ClojureScript version adding [org.clojure/clojurescript "1.10.520"]
to my build.boot file, which currently looks as follows:
(set-env!
:source-paths #{"src/cljs"}
:resource-paths #{"html"}
:dependencies '[
[adzerk/boot-cljs "2.1.5" :scope "test"]
[org.clojure/clojurescript "1.10.520"]
[pandeiro/boot-http "0.8.3"]
[org.clojure/tools.nrepl "0.2.13"]
[adzerk/boot-reload "0.6.0"]
[adzerk/boot-cljs-repl "0.4.0"]
[cider/piggieback"0.4.1" :scope "test"]
[weasel "0.7.0" :scope "test"]
[nrepl "0.6.0" :scope "test"]
])
(require '[adzerk.boot-cljs :refer [cljs]]
'[pandeiro.boot-http :refer [serve]]
'[adzerk.boot-reload :refer [reload]]
'[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]])
The problem now is back with a vengeance though within the ClojureScript REPL. I successfully connect to the nREPL started by boot getting into the boot.user
Namespace (I use the following boot command to start the nREPL boot serve -d target watch reload cljs-repl cljs target
and connect to it via boot repl -c
).
To my understanding this opens an ordinary Clojure REPL not a ClojureScript REPL. Trying to start the latter by typing (start-repl)
gives me almost the exact same error as the one above. Only that it was trying to compile org/httpkit/server.clj:1:1
rather than cljs/closure.clj:1:1
.
To me it seems that the ClojureScript REPL wants to use some default Clojurescript version which apparently differs from the one specified in the build.boot
file. I don't really understand either why I had to deviate from the tutorial by specifying the ClojureScript version there in the first place.
Any help with this will be greatly appreciated!
Best to all of you
Oliver
Addenda:
My System: ubuntu 18.04
My boot.properties:
#http://boot-clj.com
#Tue Sep 17 12:18:55 CEST 2019
BOOT_VERSION=2.8.3
BOOT_CLOJURE_VERSION=1.8.0
BOOT_CLOJURE_NAME=org.clojure/clojure
[http-kit "2.3.0"]
I still feel there must be something wrong under the hood if I have to specify these manually while tutorial doesn't even mention them… Why would my setup default to apparently deprecated versions of libs (the tutorial is a bit dated)?