Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Execute Clojure File?

How can I run a clojure file/script, which uses clojure-contrib, from the command line? My (winodws) machine has clojure-1.2.1.jar and clojure-contrib-1.2.0.jar on the classpath. Note: I can start the REPL with: java clojure.mainand I can execute *.clj files that DO NOT use clojure-contrib with: java clojure.main file-name.clj

like image 525
tmore Avatar asked Jul 13 '11 20:07

tmore


1 Answers

You need to add the clojure-contrib jar to the classpath. Since you are using windows, you add multiple classpaths by separating the entries with semicolons.

 java -cp clojure-1.2.1.jar;clojure-contrib-1.2.0.jar clojure.main file-name.clj

The above code should enable you to run your file-name.clj script which depends on clojure-contrib.

like image 151
bmillare Avatar answered Oct 06 '22 19:10

bmillare