Some Practical Clojure Examples
← prev | next →     Top-level ToC     /running-clojure-programs.html     (printable version)

1 Scripts

Download and install inlein. Then, in your scripts:

#!/usr/bin/env inlein

'{:dependencies [[org.clojure/clojure "1.8.0"]
                 [such-and-such "1.2.3"]]}

(require '[whatever.you.need :as wyn])

;; No script name, just the args you pass.
(println *command-line-args*)

2 Larger Programs

For programs using lein, with their own project directory and files, create a jar file with lein uberjar, then run the resulting jar file from anywhere via java -jar path/to/your-program-0.1.0-standalone.jar.