Petrus Theron
Petrus Theron

Reputation: 28807

Starting an nREPL with Clojure CLI Tools

How do I start an nREPL from the clj command?

I can't run my project using Lein or Boot because I have an unbalanced paren somewhere, and the reader complains `java.lang.RuntimeException: read-cond starting on line 13 requires an even number of forms.

Upvotes: 11

Views: 3028

Answers (2)

Bozhidar Batsov
Bozhidar Batsov

Reputation: 56595

Things are easier now than they were when the question was posted:

$ clj -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.5.3"}}}' -m nrepl.cmdline

More details here.

Upvotes: 9

Petrus Theron
Petrus Theron

Reputation: 28807

Wrote a gist on how to do this:

clj -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.12"}}}'
Clojure 1.9.0
user=> (use '[clojure.tools.nrepl.server :only (start-server stop-server)])
nil
user=> (defonce server (start-server :port 7888))
#'user/server

Now you can connect to port 7888 using your remote REPL client. There is probably a way to do this in one line.

Upvotes: 3

Related Questions