Leiningen is an awesome tool for getting up and running with Clojure. They have a super simple bash or .bat script for getting up and running on OS X, Linux, and Windows. The home page does an awesome job explaining how to get started with OS X and Linux but not so much on Windows.
This is a very similar process to what I wrote about previously on Setting up ANTLR4 on Windows. If you do not already, make sure that you have Java Installed (the latest version should work fine).
Create Batch Command for lein
Download lein.bat and save it somewhere. I put all of my random Java libraries in
C:\Javalib to make them easy to find. So that is where I put this bat script.
Add C:\Javalib to your PATH
- Open up File Explorer
- Right Click on This PC
- Select Properties
- On the left hand side of the new window select Advanced System Settings
- On the bottom of this screen select Environment Variables…
- Find the PATH variable
;C\Javalib\;to the existing PATH variable
Install and Test to make sure everything works
- Open up a command prompt and type in
lein self-install. This will install lein.
- Now you can type
lein replto start a REPL session
user=> (+ 2 2) ;= 4 user=> (printf "Clojure on Windows is Awesome!") ;= Clojure on Windows is Awesome!nil
If nothing is bombing out, you are all set and ready to hack on some Clojure! Why not check out the CircleCI frontend for inspiration?
If you made it this far, you should probably follow me on twitter. 🙂 Follow @levlaz