Leiningen basically gives you a REPL for running and evaluating Clojure from the command line. This is the "de facto" way to get up and running with Clojure, and it works fine. I've installed this a few times now on Mac OS, and every time I have to go look up how to do it again (scroll to the bottom for links to other tutorials on this subject). I figured writing a tutorial myself might burn it into my memory better, and also it might help out some other lucky duck that wants to start using Clojure.
Since Clojure runs on the JVM by default, Leiningen depends on the java sdk. You can check to make sure you have java like this:
Boot up your command line and navigate into your /usr/local/bin directory. If you don't have one you can create it with the mkdir command.
Curl is used for downloading things. This mysterious command is really just downloading an executable named "lein" that sets up your machine to be able to use Clojure.
You computer won't know that this is an executable file, especially since it has no extension. You can rectify this by using chmod to modify permissions with a+x to give it executable permissions.
You check the value of your $PATH variable like this:
If you don't see /usr/local/bin then I would recommend adding it to your .bash_profile file.
Executing the lein file for the first time will install everything necessary to begin working with Clojure. You can then execute the lein file like this:
You're good to go now! You should now be able to use the lein command inside of any folder! Yeah buddy! You can check that it's working by running this:
The posts on this site are written and maintained by Jim Lynch. About Jim...
Want FREE access to
my daily stock tips
"The Triple Gainers"?
Sign up here!