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
deps.edn
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
src
$ mkdir -p src
src/example/main.clj
file with
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 example.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 example.main
Hello, world
tree
command.
src/example/
main.clj
deps.edn
Justfile