Check Java, the Clojure CLI, and your first REPL before you lose time debugging the wrong layer.
When setup goes wrong, Java developers often lose time debugging the wrong thing. The fastest way to verify a Clojure environment is to check it in layers:
If you verify those in order, you can isolate most problems in a few minutes.
Clojure runs on the JVM, so if Java is missing or misconfigured, nothing above it will be reliable.
Run:
1java --version
What you want to confirm:
PATHIf this command fails, stop here and fix Java before touching Clojure-specific commands. The official install guide publishes the current supported Java LTS releases and installation recommendations.
Next, verify that the Clojure command-line tools are installed:
1clojure --version
This prints the CLI version, not just the language version.
That distinction matters:
Those versions are related, but they are not the same thing. Current official docs explicitly treat them as separate.
If clojure --version fails with “command not found”, your CLI installation is not complete yet even if Java is working.
For interactive work, prefer clj:
1clj
The official CLI reference uses clj for REPL examples because it is the friendlier interactive entry point. In many setups it gives you better line editing behavior than clojure.
Once the REPL starts, you should see a prompt like:
1user=>
Now verify a few basics:
1(clojure-version)
2;; => "1.12.4"
3
4(+ 1 2 3)
5;; => 6
6
7(map inc [1 2 3])
8;; => (2 3 4)
9
10(System/getProperty "java.version")
11;; => confirms which JVM the REPL is using
This tells you several important things at once:
To exit, use Ctrl-D.
One common failure mode is that the CLI exists, but dependency or classpath resolution is broken. A quick check is:
1clojure -Spath
This asks the CLI to compute and print the classpath it would use.
If this fails, the problem is often one of these:
deps.ednThis check is especially helpful because it fails before you waste time wondering why a project REPL or app launch is broken.
Leiningen is optional for many learners, but if your project or team uses it, verify it explicitly instead of assuming the Clojure CLI check was enough.
Start with:
1lein help
or, inside a Leiningen project:
1lein repl
If Leiningen needs to self-install supporting artifacts the first time, let it complete. Treat this as a separate layer from the Clojure CLI.
The important mental model is:
clj / clojure verifies the CLI workflowlein verifies the Leiningen workflowOne passing does not guarantee the other.
If you only want the shortest useful checklist:
1java --version
2clojure --version
3clj
4clojure -Spath
Inside the REPL:
1(clojure-version)
2(+ 1 2 3)
That is enough to prove the environment is fundamentally alive.
java --version works, but clojure --version failsJava is installed, but the Clojure CLI is not on your PATH or was not installed correctly.
clojure --version works, but clj failsThe CLI may be installed, but the interactive wrapper or terminal setup is incomplete. This can also happen on systems where clj is not provided in the same way.
clojure -Spath failsThe installation exists, but dependency resolution or local configuration is broken.
The machine is fine; the project config is probably the issue. Start reading deps.edn, project.clj, or local environment settings instead of reinstalling Java.
Verify the stack from bottom to top and the problem usually becomes obvious.