Last Updated: February 25, 2016
· splattael
Guck hoch rect

How to install clojure including startup script

I will use stow to install clojure.jar and custom script in /usr/local

Download clojure

Download clojure ZIP from and unpack it.

Prepare stow directory

As root do

mkdir -p /usr/local/stow/clojure/bin
mkdir -p /usr/local/stow/clojure/lib
# prepare startup script
touch /usr/local/stow/clojure/bin/clj
chmod a+x /usr/local/stow/clojure/bin/clj

Copy jar and create startup script

Copy clojure-1.5.1.jar from unpacked clojure ZIP to /usr/local/stow/clojure/lib.
Make sure that JAR is world readable.

In /usr/local/stow/clojure/bin paste into clj


exec java -cp $JAR clojure.main "$@"


cd /usr/local/stow
stow -v clojure

Use startup script

As REPL just run clj:

$ clj 
Clojure 1.5.1

To execute a clojure script file just pass it to clj as argument:

clj hello.clj

Have fun!