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.
To start a REPL session in Eclipse, click the Menu option, go to Run As → Clojure Application. This will start a new REPL session in a separate window along with the console output.
You can exit the REPL by typing Ctrl+D (pressing the Ctrl and D keys at the same time).
nREPL is a Clojure network REPL that provides a REPL server and client, along with some common APIs of use to IDEs and other tools that may need to evaluate Clojure code in remote environments.
The easiest way to start a Clojure REPL is with using the clj command of the Clojure CLI tools: You should see output like the following: See Getting Started to learn how to install the Clojure CLI.
A history of nREPL builds is available, as well as a compatibility test matrix, verifying nREPL's functionality against multiple versions of Clojure and multiple JVMs. Most of the time, you will connect to an nREPL server using an existing client/tool.
See Deps and CLI for a complete reference. See the changelog for version information. After you download and install the tools, you can start a REPL by running the clj tool: Once in the REPL you can type Clojure expressions and press enter to evaluate them.
nREPL is a Clojure n etwork REPL that provides a REPL server and client, along with some common APIs of use to IDEs and other tools that may need to evaluate Clojure code in remote environments. nREPL is available in Maven central.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With