Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure by

My Clojure/Lein/Cider combo is broken. I would like to completely remove everything and reinstall, but do not know what "everything" amounts to.

Thanks in advance,

1 Answer

0 votes

The answer to that is going to depend on how you installed them (and what O/S you're on etc).

Hello! Thanks for responding.

Running on
macOS Catalina 10.15.6
Java: OpenJDK Runtime Environment (build 1.8.0_282-b08)

lein installed using homebrew:

Doing a find on clojure*.jar:

{I have tried playing with clojure in the past}

emacs clojure-mode:

Contents of ~/.lein/profiles.clj:
{:user {:plugins [[cider/cider-nrepl "0.8.1"]]}}%

Doing a find on cider*:

lein repl
errors out. Error starts with:
clojure.lang.Compiler$CompilerException: Syntax error compiling at (cider/nrepl.clj:1:1).
#:clojure.error{:phase :compile-syntax-check, :line 1, :column 1, :source "cider/nrepl.clj"}

followed by the stack trace. In the middle of it is:
Caused by: java.io.FileNotFoundException: Could not locate clojure/tools/nrepl/server__init.class, clojure/tools/nrepl/server.clj or clojure/tools/nrepl/server.cljc on classpath.

and more stack trace.

It occurs to me that the cider version under elpa is totally different. Could that be the problem?
The problem with lein repl is that you have an extremely old version of cider-nrepl specified in your ~/.lein/profiles.clj file and it has syntax that is no longer accepted by Clojure.

The first thing to try is changing version 0.8.1 to 0.25.8 in ~/.lein/profiles.clj

If that doesn't get lein repl running, just delete your ~/.lein/profiles.clj file (having inappropriate plugins or outdated plugins).

You have the latest Clojure CLI installed, so you should be able to run this to get a REPL too: clj
Thank you!
lein repl is back and cider-jack-in works too.
But cider-jack-in is telling me I should upgrade cider.
How do I do that safely? And what version should I be on the lookout for?
No idea about Emacs/CIDER, sorry. I haven't used those for many years.
That's okay. Out of curiosity - what editor/IDE do you use?
I switched from Emacs/CIDER to Atom/ProtoREPL about four or five years ago, then ProtoREPL became unmaintained so I switched to Atom/Chlorine (which I really like because you only need a plain Socket REPL -- no dependencies at all) and then the Chlorine author ported it to VS Code as Clover last year and, at that point, I switched to VS Code/Clover.

And now Calva has a mode that disables its own REPL UI so I now have VS Code/Clover+Calva (still using Clover for REPL stuff, but able to leverage all the LSP-driven static code analysis from Calva, which is great, and I was able to uninstall a bunch of other VS Code extensions because Calva "does all that").