Fork me on GitHub

Hello! Is there a way to install clojure cli without root access for mac? I was looking at but doesn't seem to provide what i want. Is there a Clojure jar with depencies that i can download from maven? (The reason I don't have root access is that is my work laptop. We have a way to get lein downloaded and we have been using that but am trying to use deps.edn)


Do you have permission to install Homebrew, or is it already installed and you have permission to add new Homebrew packages/(whatever-Homebrew-calls-them)?


You can also check out the Linux version, which has a shell script it uses to install and can be given a prefix to install in

Alex Miller (Clojure team)03:01:59

^^ that's probably a better bet for this case, although it may need some slight modification to work on Mac (don't remember)


I don't have homebrew or permissions to install homebrew sadly 😕


I was looking at the Linux version and it seems I require sudo access?


hmm actually it looks like a simple script maybe i can modify it hmmm

Alex Miller (Clojure team)04:01:58

you can, it's nothing too fancy


Yeap I do need to change it a bit - mac, at least my version of mac doesn't have the -D flag on install. So need separate commands to create the folder paths mkdir -p , cp and chmod


does anyone happen to know how to install rlwrap like perhaps as a binary?


like a pkgs for mac :thinking_face:

Alex Miller (Clojure team)06:01:15

you don't technically need rlwrap

Alex Miller (Clojure team)06:01:35

it's just nice if you're using a repl from clj


So for commands that ask for clj i can run clojure instead?


Can I put docstrings to specs somehow?

Alex Miller (Clojure team)13:01:16

No, this is I think the most requested feature of spec

clojure-spin 1

I am putting together small rest api (stateless). First checked the luminus, but it had a bunch of stuff that I dont need. Anyways, I am using mount for "stateful components", run reitit routes through ring/jetty + next.jdbc. My question is general. Trying to model it correctly. If I run mount/start -> it will start 3 stateful components (config, dbconn, http). My understanding now leaks a bit, i do not need to run this in seperate threads(the mount/start stuff)? As jetty-adapter has its own threadpool it orchestrates? So the presumed bottleneck might be in dbconn, as I have one for now? So those stateful references are available to jetty threads and for example if jetty threadpool has 50 threads, each will reach for the same db conn?


you usually want to set it up so they reach for the same db connection pool and the pool manages some limited number of connections to the db. But often the db connections are fewer than the request threads


thanks, so my understanding is correct all http threads see the same mount reference? (from main thread?)


Is there a clojure cli equivalent of lein deps :tree?

Darin Douglass20:01:28

clj -Xdeps tree


Strictly speaking it's clj -X:deps tree -- aliases are supposed to start with : so -Xdeps might stop working at some point.

🙌 1

If your CLI is up-to-date, clojure -X:deps list can be useful too, listing just the final selected dependencies with their license information if available.


Thanks that's helpful! For some reason google wasn't bringing this up for me


Hello clojurians, I'm using to create an uberjar. This works fine on my local machine, but on my server it fails for some reason. This is the short error message (full message in thread)

syntax error (IllegalArgumentException) compiling new at (lhrb/words/core.clj:210:22).
Unable to resolve classname: GzipHandler
I import the GzipHandler like this (:import [org.eclipse.jetty.server.handler.gzip GzipHandler]) I use on both machines Clojure CLI version and openjdk 17.0.1 2021-10-19


 "Syntax error (IllegalArgumentException) compiling new at (lhrb/words/core.clj:210:22).\nUnable to resolve classname: GzipHandler\n",
 {:clojure.error/phase :compile-syntax-check,
  :clojure.error/line 210,
  :clojure.error/column 22,
  :clojure.error/source "core.clj",
  :clojure.error/symbol new,
  :clojure.error/path "lhrb/words/core.clj",
  :clojure.error/class java.lang.IllegalArgumentException,
  :clojure.error/cause "Unable to resolve classname: GzipHandler"},
  [{:type clojure.lang.Compiler$CompilerException,
    "Syntax error compiling new at (lhrb/words/core.clj:210:22).",
    {:clojure.error/phase :compile-syntax-check,
     :clojure.error/line 210,
     :clojure.error/column 22,
     :clojure.error/source "lhrb/words/core.clj",
     :clojure.error/symbol new},
    :at [clojure.lang.Compiler analyzeSeq "" 7119]}
   {:type java.lang.IllegalArgumentException,
    :message "Unable to resolve classname: GzipHandler",
  [[clojure.lang.Compiler$NewExpr$Parser parse "" 2667]
   [clojure.lang.Compiler analyzeSeq "" 7111]
   [clojure.lang.Compiler analyze "" 6793]
   [clojure.lang.Compiler analyzeSeq "" 7099]
   [clojure.lang.Compiler analyze "" 6793]
   [clojure.lang.Compiler access$300 "" 38]
   [clojure.lang.Compiler$LetExpr$Parser parse "" 6388]
   [clojure.lang.Compiler analyzeSeq "" 7111]
   [clojure.lang.Compiler analyze "" 6793]
   [clojure.lang.Compiler analyzeSeq "" 7099]
   [clojure.lang.Compiler analyze "" 6793]
   [clojure.lang.Compiler analyzeSeq "" 7099]
   [clojure.lang.Compiler analyze "" 6793]
   [clojure.lang.Compiler analyze "" 6749]
   [clojure.lang.Compiler$HostExpr$Parser parse "" 1020]
   [clojure.lang.Compiler analyzeSeq "" 7111]
   [clojure.lang.Compiler analyze "" 6793]
   [clojure.lang.Compiler analyzeSeq "" 7099]
   [clojure.lang.Compiler analyze "" 6793]
   [clojure.lang.Compiler analyze "" 6749]
   [clojure.lang.Compiler$BodyExpr$Parser parse "" 6124]
   [clojure.lang.Compiler$FnMethod parse "" 5471]
   [clojure.lang.Compiler$FnExpr parse "" 4033]
   [clojure.lang.Compiler analyzeSeq "" 7109]
   [clojure.lang.Compiler analyze "" 6793]
   [clojure.lang.Compiler analyzeSeq "" 7099]
   [clojure.lang.Compiler analyze "" 6793]
   [clojure.lang.Compiler access$300 "" 38]
   [clojure.lang.Compiler$DefExpr$Parser parse "" 596]
   [clojure.lang.Compiler analyzeSeq "" 7111]
   [clojure.lang.Compiler analyze "" 6793]
   [clojure.lang.Compiler analyze "" 6749]
   [clojure.lang.Compiler compile1 "" 7730]
   [clojure.lang.Compiler compile "" 7802]
   [clojure.lang.RT compile "" 411]
   [clojure.lang.RT load "" 457]
   [clojure.lang.RT load "" 424]
   [clojure.core$load$fn__6856 invoke "core.clj" 6115]
   [clojure.core$load invokeStatic "core.clj" 6114]
   [clojure.core$load doInvoke "core.clj" 6098]
   [clojure.lang.RestFn invoke "" 408]
   [clojure.core$load_one invokeStatic "core.clj" 5897]
   [clojure.core$compile$fn__6861 invoke "core.clj" 6125]
   [clojure.core$compile invokeStatic "core.clj" 6125]
   [clojure.core$compile invoke "core.clj" 6117]
   [user$eval136 invokeStatic "compile.clj" 6]
   [user$eval136 invoke "compile.clj" 1]
   [clojure.lang.Compiler eval "" 7181]
   [clojure.lang.Compiler load "" 7640]
   [clojure.lang.Compiler loadFile "" 7578]
   [clojure.main$load_script invokeStatic "main.clj" 475]
   [clojure.main$script_opt invokeStatic "main.clj" 535]
   [clojure.main$script_opt invoke "main.clj" 530]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "" 137]
   [clojure.lang.Var applyTo "" 705]
   [clojure.main main "" 40]],
  :cause "Unable to resolve classname: GzipHandler",
  :phase :compile-syntax-check}}

Alex Miller (Clojure team)22:01:31

Seems like you somehow must not have that Jetty class in the deps basis that's used to compile your uber jar. If you can load your build file and examine the basis you created, it should have a :libs key that is a map of lib name to coordinate. The compile step should leave some of it's work (like a classpath file) in the tmp dir when it fails like this.

Alex Miller (Clojure team)22:01:18

You can either find the tmpdir root with (System/getProperty "") or even set it somewhere you can see with on your Clojure CLI command line - whatever the newest subdirectory there is is probably it

Alex Miller (Clojure team)22:01:04

I guess it would be interesting to compare clj -Stree in both envs too to see if they differ


🙏 thanks a lot for your answer. I'm trying to figure it out.