11

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.

Petrus Theron
  • 27,855
  • 36
  • 153
  • 287

2 Answers2

9

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.

Bozhidar Batsov
  • 55,802
  • 13
  • 100
  • 117
3

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.

Petrus Theron
  • 27,855
  • 36
  • 153
  • 287
  • 1
    You can even use gists with tools.deps.alpha, see https://gist.github.com/bhb/2686b023d074ac052dbc21f12f324f18 – slipset Mar 01 '18 at 13:56