cd
into it.
$ mkdir project
$ cd project
Justfile
and put the following into
it.
# Shows available recipies
help:
just --list
just help
$ just help
just --list
Available recipes:
help # Shows available recipes
src
$ mkdir -p src
deps.edn
in that folder with the
following contents.
This is what sets the version of Clojure to use and tells Clojure that
your code will be in the src
folder.
{:paths ["src"]
:deps {org.clojure/clojure {:mvn/version "1.12.0"}}}
For the rest of this we will use example
, but feel free
to pick something else. Just replace example
in all the
following instructions with whatever you picked
main.clj
in that folder with the
following contents.
(ns example.main)
(defn -main []
(println "Hello, world"))
$ clojure -M -m example.main
Hello, world
The first -M
means you are want to run the function named
-main
. The second, lower-cased, -m
means you
want to run the -main
function in the
example.main
namespace.
Justfile
# Shows available recipes
help:
just --list
run:
clojure -M -m main
just run
This will be very useful once running your project takes more than an easy to remember command.
$ just run
clojure -M -m main
Hello, world
tree
command.
src/
main.clj
deps.edn
Justfile