We’ll be using Ubuntu Linux during this course. You have two options:
Not So Easy Option: Install Ubuntu on a hard disc partition on your computer or on a virtual machine.
The following instructions allow you to install the most recent version of Clojure on Ubuntu 14.04.
NOTE: You can skip this step if you’re using the Cloud9 development environment.
Verify that you have Java installed. Type at the terminal:
java -version
If you get a “command not found” error you can install Java with this instruction:
sudo apt-get install openjdk-7-jdk
Download the Leiningen script:
wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
Make the script executable:
chmod +x lein
Move the script to the /usr/local/bin
directory:
sudo mv lein /usr/local/bin
Run the Clojure REPL (Read-Eval-Print-Loop):
lein repl
Press Ctrl-D
to quit the REPL.
Install lein-exec, which is a Leiningen plugin to execute Clojure scripts:
echo '{:user {:plugins [[lein-exec "0.3.5"]]}}' > ~/.lein/profiles.clj
Now, to run a Clojure script called my_script.clj
just type:
lein exec my_script.clj