Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clojure REPL in Windows

I would like to learn Clojure, but rather than opening up a full-on IDE each time I'd like to be able to have a batch file (or similar) that opens up a decent REPL for quickly hacking examples. (i.e. I'm not looking for an Emacs/Netbeans/Eclipse IDE discussion).

For instance, this starts up the most basic REPL:

cd C:\Program Files\Java\clojure-1.2.0\
java -cp clojure.jar clojure.main

and if you add the jline and clojure-contrib jar files to the clojure directory then

cd C:\Program Files\Java\clojure-1.2.0\
java -cp .;jline-0_9_5.jar;clojure.jar;clojure.contrib.jar jline.ConsoleRunner clojure.main
like image 978
Alistair Collins Avatar asked Feb 16 '11 14:02

Alistair Collins


2 Answers

Take a look at leiningen. From there, download the windows zip, put the lein directory in your PATH and run:

lein repl

Enjoy!

like image 140
Matthew Boston Avatar answered Sep 29 '22 01:09

Matthew Boston


For a stand alone repl with decent classpath management take a look at cljr:

https://github.com/liebke/cljr

This provides a cljr.bat script that works very nicely under windows and provides convenient management of what is on the classpath and the ability to downloand/install clojure packages.

like image 27
Alex Stoddard Avatar answered Sep 29 '22 01:09

Alex Stoddard