1
votes

I am on Mojave and can't get leiningen to work.

I was using java 8, and then tried upgrading to 11 to no avail. Currently using:

openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment AdoptOpenJDK (buildb11.0.7+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)

I have tried copying lein to my /usr/local/bin and brew install but in both cases I get the error:

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.
1
Can you share some more information? How do you run leiningen? What is your project setup? Usually, nrepl should just come up inside a leiningen project. See nrepl.org/nrepl/usage/server.html#_using_leiningen - Stefan Kamphausen
So I was merely trying to learn clojure, and this seemed like one of the first steps. I merely brew installed lein and tried copying the script from github. More specifically I was following: braveclojure.com/getting-started and tried running lein new app clojure-noob - user2820906
Hm, that should indeed Just Work. I'm on Linux and only ever downloaded the lein bash script manually as described on leiningen.org. You are certainly on the right track! - Stefan Kamphausen
Sadly I am on no track now! Without lein working not really sure where to go from there with clojure. I saw boot exists, so i guess i could try that, but I am really confused as to why this isn't just working. - user2820906
I'm really sorry that I'm not able to help you with this. I'm on Linux, so can't test this. - Stefan Kamphausen

1 Answers

1
votes

I had a similiar problem recently on macOS Mojave (10.14.6). The following command did the trick for me:

rm -rf .lein

However, before you run this line, please make sure that...

  1. ... you are in your home directory.
  2. ... .lein is a directory associated with your leiningen installation and nothing else!
  3. ... that you have a backup of any config files, custom packages, etc. that are associated with your leiningen installation.

Once you hit enter the .lein directory will be deleted. The directory will be rebuild when you start the repl via leinigen lein repl.