Clojure Tutorial: Run/Execute One Clojure File

By Xah Lee. Date: . Last updated: .

How to run a single Clojure file?

Run a single Clojure file like this:

java -cp clojure.jar clojure.main ‹filename›
;; save this in a file named x.clj, and you can run it by
;; java -cp clojure.jar clojure.main x.clj
(println (+ 3 4))

Reference

http://clojure.org/repl_and_main

If you have a question, put $5 at patreon and message me.

Clojure

  1. Clojure Install
  2. Leiningen Basics
  3. Emacs CIDER
  4. Doc Lookup, Find f

  1. Clojure Basics
  2. List, Map, …
  3. Functions
  4. Function Chaining
  5. Partial Function
  6. Binding Form
  7. regex
  8. Namespace
  9. metadata
  10. macro
  11. Calling Java
  12. Magic Chars '\@^#`~.

misc