+1  A: 

Install MacPorts and then run sudo port install clojure

greg
+2  A: 

If you just want to run clojure programs, then macports works. Bear in mind you're dependent upon the maintainer to update versions.

If you plan on writing clojure programs, then cake is a better starting point. Installation involves one of the following (your choice):

Using gem (easiest)

  1. gem install cake

Standalone script

  1. Download the script
  2. Put it somewhere in your path and chmod +x cake to make it executable

Git repository

  1. git clone git://github.com/ninjudd/cake.git
  2. Symlink bin/cake into your path and make it executable

Cake is a full build system, but you can just use it to fire up the repl by running cake repl. There's also leiningen, but starting repls will feel faster in cake since it uses persistent JVMs.

Alex Taggart
Thanks, but I tried the first two methods and both failed. Please see my edit(s) an ask questions / offer suggestions.
Hamish Grubijan
Odd. What version of ruby do you have? I know it works on 1.8.7. While unlikely to be the cause, try running without sudo.
Alex Taggart
1.8.7 | tried with and without | Looks like I need to upgrade gems http://help.rubygems.org/faqs/rubygems/why-do-i-get-http-response-302-or-301-when-installing-a-gem I am wondering though - how is Ruby involved in this? Is Clojure pretending to be a ruby package?
Hamish Grubijan
Cake is written in ruby, which then manages the persistent JVMs. As for java, clojure requires 1.5 which should already be in your Mac.
Alex Taggart
@Alex, I believe one of these commands left my system in a bad state (cannot use network interface in any form). How can I undo/cleanup these commands?
Hamish Grubijan
+2  A: 

I find Leiningen very easy to use. Just download the script, put it somewhere in your $PATH (/usr/bin/ for example) and make it executable: sudo chmod +x lein. Now type lein repl and Leiningen will download all the files you need and create a REPL for you. It's that easy.

Tenso
+2  A: 

You may want to check CounterClockWise (an Eclipse plugin). There's a video on how to install it here. It'll give you a lot of features to play with - including a clojure REPL.

lazy1
Would doing it this way screw up an existing Clojure installation?
Hamish Grubijan
Also, what version of Eclipse and Java do I want for this?
Hamish Grubijan
+1 for CounterClockwise - I find it is a great tool (largely because my coding is 75% Java so I need Eclipse, but want to write Clojure as well without switching to a different environment). I use Eclipse 3.6.1 with the latest stable CounterClockwise update from http://updatesite.counterclockwise.googlecode.com/hg/
mikera
@Hamish - I don't think it will impact any other Clojure distribution, actually I think CounterClockwise even bundles a version of the Clojure jars to make things easy if you don't have another set of Clojure libraries handy.
mikera
I just use the eclipse that comes with Ubuntu, but my guess it's the "Eclipse IDE for Java Developers" on the download page.
lazy1
+2  A: 

Just checked this will still work under Ubuntu. It should be the same for macs, except using whatever macs use instead of apt-get to install maven:

http://www.learningclojure.com/2010/08/clojure-emacs-swank-slime-maven-maven.html

You need to install maven, create a file, then you can just call mvn clojure:repl and everything should just work.

If you'd also like the whole emacs-swank-slime setup that's also easy now, and described there.

If you try it can you comment back here or on the blog to let me know if there are any changes I need to make for macs?

John Lawrence Aspden
Thanks, and just in case - how can it be uninstalled?
Hamish Grubijan
You'd need to uninstall maven, delete the maven local repository .m2, and then get emacs back into its previous state, probably by deleting the .emacs and .emacs.d file and directory tree and restoring them from backup. -- If you have an emacs setup that you're happy with and are worried about messing with then you should back it up before adding ELPA and installing the clojure related packages. -- In fact I would try it out on a new user account first and see if you like it all! -- I will add a note about this to the original article, since it would obviously be of concern to first-timers
John Lawrence Aspden
+3  A: 

Clojure is also installable via Homebrew:

Adam Vandenberg
Thanks, and just for the fun of it - how can it be uninstalled?
Hamish Grubijan
"brew remove clojure" to remove clojure; Homebrew's wiki has an uninstall section.
Adam Vandenberg
A: 

I once created a package called ClojureX that was partly based on Mark's article. It's not actively maintained anymore (at least not by me), but there's no reason it wouldn't work:

http://github.com/citizen428/ClojureX

Michael Kohl