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,
Bruce

1 Answer

0 votes
by

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

by
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:
/usr/local/Cellar/leiningen/2.9.5/bin/lein

Doing a find on clojure*.jar:
/usr/local/Cellar/clojure/1.10.2.774/libexec/clojure-tools-1.10.2.774.jar
.m2/repository/org/clojure/clojure/1.3.0/clojure-1.3.0.jar
.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar
.m2/repository/org/clojure/clojure/1.8.0/clojure-1.8.0.jar
.m2/repository/clojure-complete/clojure-complete/0.2.4/clojure-complete-0.2.4.jar
.m2/repository/clojure-complete/clojure-complete/0.2.5/clojure-complete-0.2.5.jar

{I have tried playing with clojure in the past}

emacs clojure-mode:
.emacs.d/elpa/clojure-mode-20201126.1558

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

Doing a find on cider*:
.m2/repository/cider/cider-nrepl/0.8.1/cider-nrepl-0.8.1.jar
.emacs.d/elpa/cider-20210127.640

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?
by
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
by
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?
by
No idea about Emacs/CIDER, sorry. I haven't used those for many years.
by
That's okay. Out of curiosity - what editor/IDE do you use?
by
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").
...