Follow the Data

A data driven blog

Launch script for clojure

Yesterday I was trying to get the clojure web framework compojure running, but I had some troubles. It seems that the version of clojure I was running wasn’t compatible with the latest and greatest compojure off github, or that I hadn’t included all jars needed. I found a tip on one of the comments here for specifying a folder where all jars are included which takes the pain out of adding each jar singlehandedly. So I have now adapted my script to start clojure which was taken from http://mark.reid.name/sap/setting-up-clojure.html, but changed so that it includes a full folder’s worth of jars instead of specifying each jar by itself.

Here’s my new launch script for clojure:

#!/bin/bash
JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java
EXT_DIRS=$HOME/local/clojure

# Add extra folders as specified by `.clojure_libs` file
if [ -f .clojure_libs ]
then
EXT_DIRS=$EXT_DIRS:`cat .clojure_libs`
fi

if [ -z "$1" ]; then
$JAVA -server -Djava.ext.dirs=$EXT_DIRS \
jline.ConsoleRunner clojure.lang.Repl
else
scriptname=$1
$JAVA -server -Djava.ext.dirs=$EXT_DIRSĀ  clojure.lang.Script $scriptname -- $*
fi

Now that I have a working base default setup of compojure it is time to start writing something useful! Will need to make slime work without hiccups too.

About these ads

Single Post Navigation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 120 other followers

%d bloggers like this: