Noob: Getting (re)started with Clojure on OS X

718 views
Skip to first unread message

Kenneth Reid Beesley

unread,
Mar 13, 2019, 12:56:23 PM3/13/19
to Clojure
I played happily with Clojure/leiningen several years ago, on OS X, but I'm having trouble getting restarted.

I have
macOS High Sierra Version 10.13.6
java version 1.8.0_05

and I just did

$ brew upgrade leiningen
(it confirms that I have leiningen 2.9.1 already installed)

and
$ brew install clojure
(I now have stable 1.10.0.414)

But then I try

$ lein repl

and get

WARNING: You have $CLASSPATH set, probably by accident.

It is strongly recommended to unset this before proceeding.

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"}

 at clojure.lang.Compiler.load (Compiler.java:7647)

...


and


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.

 at clojure.lang.RT.load (RT.java:466)

...


********************


So, where am I going wrong?  How do I get back in the Clojure saddle on OS X?


Ken Beesley

Sean Corfield

unread,
Mar 13, 2019, 1:20:08 PM3/13/19
to clo...@googlegroups.com

Check what’s in your ~/.lein/profiles.clj file – that’s usually the cause of bizarre errors that people report with Leiningen.

 

Also check your environment variables: env|fgrep CLASSPATH

 

Per the warning, you probably want to remove whatever is setting that (from one of your shell’s dot files, perhaps?).

 

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

 


From: clo...@googlegroups.com <clo...@googlegroups.com> on behalf of Kenneth Reid Beesley <krbe...@gmail.com>
Sent: Wednesday, March 13, 2019 9:47:24 AM
To: Clojure
Subject: Noob: Getting (re)started with Clojure on OS X
 
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kenneth Beesley

unread,
Mar 13, 2019, 1:43:01 PM3/13/19
to clo...@googlegroups.com
Many thanks for the reply.

My ~/.lein/profiles.clj file looks like

{:user {:plugins [[cider/cider-nrepl "0.8.2"]]}}

What should it look like?

*****

I've used Java quite a bit, and my CLASSPATH is extensive.
It’s set in my ~/.bashrc

What’s my next step?

Best,

Ken

*******************************
Kenneth R. Beesley, D.Phil.
PO Box 540475
North Salt Lake UT 84054
USA






Kenneth Beesley

unread,
Mar 13, 2019, 1:54:35 PM3/13/19
to clo...@googlegroups.com
On 13Mar2019, at 10:19, Sean Corfield <se...@corfield.org> wrote:

Check what’s in your ~/.lein/profiles.clj file – that’s usually the cause of bizarre errors that people report with Leiningen.

Hello Sean,

Hah!  I changed my ~/.lein/profiles.clj from

{:user {:plugins [[cider/cider-nrepl "0.8.2"]]}}

to

{:user {:plugins [[lein-pprint "1.1.1"]]
        :dependencies [[slamhound "1.3.1"]]}}

and now ‘lein repl’ launches.

Anything else I should add to ~/.lein/profiles.clj ?

Many thanks!

Ken

Mike Rodriguez

unread,
Mar 13, 2019, 9:45:35 PM3/13/19
to Clojure

[cider/cider-nrepl "0.8.2"]

is quite old. It looks like lein 2.9.1 (as of 2.8.2) uses a newer version of nrepl that requires cider-nrepl 0.18+ or something along those lines. 
In newer versions of cider, you may not need to include this plugin at all. I know that the "jack-in" commands of cider can do it automatically for you at least. If removing the dep works fine for your workflow, I'd stick with that. Less is more. :-P

Nathan Fisher

unread,
Mar 13, 2019, 11:35:24 PM3/13/19
to clo...@googlegroups.com
I would even argue against using central profiles. I think it obscures behavioural differences between machines and can impair reproducibility. Arguably better to have all deps in project where possible.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
- sent from my mobile

Sean Corfield

unread,
Mar 14, 2019, 12:43:56 PM3/14/19
to clo...@googlegroups.com

With modern versions of CIDER, those dependencies are injected automatically (and with the correct version).

 

I would advise keeping as little as possible in your profiles.clj file – it’s possibly the number one cause of problems for Leiningen users because people forget they have some plugin or dependency in there and months later it conflicts with some new project they’re working on in weird ways.

 

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

 


From: clo...@googlegroups.com <clo...@googlegroups.com> on behalf of Kenneth Beesley <krbe...@gmail.com>
Sent: Wednesday, March 13, 2019 10:54:19 AM
To: clo...@googlegroups.com
Subject: Re: Noob: Getting (re)started with Clojure on OS X
 

marcp...@gmail.com

unread,
May 2, 2019, 7:01:18 PM5/2/19
to Clojure
Had the same issue and solved updating cider-nrepl to 0.21.1 in my profile

For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clo...@googlegroups.com.

R Aguilera

unread,
Mar 28, 2020, 9:43:29 PM3/28/20
to Clojure
I was having the same issue as above and deleting my `lein` folder in my root directory solved my issue. Thank you so much, I was about to give up learning Clojure.

For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages