Fork me on GitHub

I'm not sure if this is the correct place to ask but... I just spent over an hour trying to figure out why I got this:

$ clj
Error building classpath. class clojure.lang.Symbol cannot be cast to class clojure.lang.Keyword (clojure.lang.Symbol and clojure.lang.Keyword are in unnamed module of loader 'app')
java.lang.ClassCastException: class clojure.lang.Symbol cannot be cast to class clojure.lang.Keyword (clojure.lang.Symbol and clojure.lang.Keyword are in unnamed module of loader 'app')
	at clojure.lang.Keyword.compareTo(
	at clojure.lang.APersistentVector.compareTo(
	at clojure.core$compare.invokeStatic(core.clj:842)
	at clojure.core$compare.invoke(core.clj:833)
	at java.base/java.util.TimSort.binarySort(
	at java.base/java.util.TimSort.sort(
	at java.base/java.util.Arrays.sort(
	at clojure.core$sort.invokeStatic(core.clj:3103)
	at clojure.core$sort.invokeStatic(core.clj:3090)
	at clojure.lang.RestFn.applyTo(
	at clojure.lang.Var.applyTo(
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.main$main_opt.invokeStatic(main.clj:514)
	at clojure.main$main_opt.invoke(main.clj:510)
	at clojure.main$main.invokeStatic(main.clj:664)
	at clojure.main$main.doInvoke(main.clj:616)
	at clojure.lang.RestFn.applyTo(
	at clojure.lang.Var.applyTo(
	at clojure.main.main(
and was digging through tools.deps sources which led me here: and then found out that one of my my libspecs had a : in front of it... and thus that sort was being invoked with something like:
(sort '[[:com.wsscode/pathom-viz lilactown/helix cljs-bean/cljs-bean] [nubank/workspaces cljsjs/highlight])
So the request would be for some better error/sanity checking when building the classpath map, to confirm the data is valid.


There are tools that do linting of deps.edn files already


Thanks, I'm aware of kondo's ability to lint deps files. Personally I experienced performance problems when I used it last (integrating with cursive), but I'll try it again. I would say though, because t.d.a is such an essential tool when working with clojure I think it makes sense to add basic sanity checking to the config map. Imagine someone new to the language who has a single character typo and as a result sees that stacktrace which gives no clue as to how to proceed or where to look. Seems like a great opportunity to improve the user experience of using clojure.

Alex Miller (Clojure team)05:12:19

thanks, we have specs for the deps file but for historical reasons, they're not being used yet, thanks for the bump

🙂 1

hi! is there a way to set the jvm version clojure cli uses? didn’t manage to find anything in the docs.

Alex Miller (Clojure team)13:12:42

It uses whatever Java version you have on the path

Alex Miller (Clojure team)13:12:23

So totally up to you :)


got it! thank you alex!

Kira McLean21:12:21

Can I use a project that uses leiningen as a local dep (i.e. is there some way to tell tools.deps the manifest type is a project.clj file?

Alex Miller (Clojure team)21:12:16

currently, no but there is a pending ticket/patch for this

Kira McLean22:12:46

cool! thanks 🙏


@kiraemclean A workaround could be to add the deps of that project to your project and then include that project using {:git/url ... :sha ... :deps/manifest :deps}


or :local/root as you asked


but since you already have that project locally, you can also use lein pom to write a pom.xml and then tools.deps will understand it without any other changes

👍 2
Kira McLean23:12:12

ah amazing, this is very helpful, thanks 🙂 relatedly.. need to learn better debugging skills for Clojure. I’m trying to debug a weird issue and want to dig around the source of a library but finding it hard with just my editor 😭


Just give me a shout if you want some hands on help or a pairing session

🙏 1