Setting up Clojure 1.2 for Mac OS X 10.6 (Snow Leopard)

These instructions are an amplification and some corrections (due to changes in standard Clojure distributions) on Mark Reid’s instructions, with a nod towards Ken Sipe). This will get you a Clojure 1.2 command line prompt.

First, create a directory for Clojure.

mkdir -p ~/Library/Clojure/lib

Second, download the core Clojure and Clojure contrib, and JLine packages. mkdir -p ~/Library/Clojure/tmp cd ~/Library/Clojure/tmp wget --no-check-certificate wget --no-check-certificate wget

Third, unzip these, and put the jar files into the lib directory. unzip unzip unzip cp clojure-1.2.0/clojure.jar ~/Library/Clojure/lib/clojure.jar cp clojure-contrib-1.2.0/target/clojure-contrib-1.2.0.jar ~/Library/Clojure/lib/clojure-contrib.jar cp jline-0.9.94/jline-0.9.94.jar ~/Library/Clojure/lib/jline.jar

If you like, you can delete the tmp directory created above.

Fourth, create a clj command and place it somewhere in an executable location.

It should look something like this (mostly like Ken Sipe’s command).


Runs Clojure using the classpath specified in the .clojure file of the

current directory.

Will Fitzgerald 2011-01-18, based on:

Ken Sipe 2010-02-20,

Inspired by Mark Reid

Sipe's code:



This scripts expects java to be define.

clojure.jar, clojure-contrib.jar, and jline.jar should be in



Add extra jars as specified by .clojure file

if [ -f .clojure ] then CP=$CP:cat .clojure fi

if [ -z "$1" ]; then java -server -cp $CP jline.ConsoleRunner clojure.main else java -server -cp $CP clojure.main -i $* fi

You should now be able to execute clj or clj some.clj.

Leave a Reply

Your email address will not be published. Required fields are marked *