Confirm that your terminal can find a real JDK before installing Clojure, and learn what java, javac, PATH, and JAVA_HOME tell you about the JVM your tools will use.
Clojure runs as JVM bytecode, so the first setup question is not “is Clojure installed?” It is “which Java runtime will this terminal, editor, build tool, and REPL actually use?”
For Java engineers, the useful check is deliberately simple:
1java -version
2javac -version
java proves that a JVM runtime is available. javac proves that a Java Development Kit (JDK) is available, not merely a runtime image. Clojure itself does not make you write Java first, but real JVM development is easier when the compiler, tools, and diagnostics are present.
| Command | What it checks | Healthy result |
|---|---|---|
java -version |
Runtime selected by your shell | A supported Java version from the JDK you expect |
javac -version |
Compiler available on PATH |
Same major version as java |
echo $JAVA_HOME or echo %JAVA_HOME% |
Explicit JDK home, if configured | Root of the same JDK, not its bin directory |
which java or where java |
Executable location | A path that matches your intended JDK manager or install location |
Official Clojure guidance currently treats Java 8 as the minimum and recommends Java 25; Clojure also supports Java LTS releases. For a learning machine, pick a current LTS JDK unless your workplace project requires another version.
Java teams often inherit machines with more than one Java install. The common failure is having java available but not javac.
| If this happens | Likely meaning | Fix direction |
|---|---|---|
java -version works, javac -version fails |
Runtime without full JDK, or JDK bin missing from PATH |
Install a JDK or fix PATH |
| Versions differ | java and javac come from different installs |
Align PATH, JAVA_HOME, or version manager |
| Terminal works, IDE fails | IDE has its own configured JDK | Set the project/editor JDK explicitly |
| IDE works, terminal fails | Shell startup files do not select the JDK | Fix terminal environment first |
Do this check from the terminal before relying on the editor. Clojure tooling is frequently launched from shell commands, build scripts, or editor integrations that inherit shell-like environment assumptions.
Run these from the directory where you plan to create or open the Clojure project:
1java -version
2javac -version
On macOS or Linux, also inspect the executable:
1which java
2which javac
On Windows Command Prompt:
1where java
2where javac
3echo %JAVA_HOME%
On PowerShell:
1Get-Command java
2Get-Command javac
3$env:JAVA_HOME
The goal is consistency, not a particular vendor banner. If your Java team standardizes on Temurin, Oracle JDK, Microsoft Build of OpenJDK, Azul, or another distribution, Clojure does not care as long as a supported JDK is available and the classpath behaves normally.
For a team repository, record the expected Java version in the README, build docs, or tool configuration. Do not rely on “whatever the developer has installed.”
Useful notes include:
That documentation prevents the most common Clojure onboarding problem: one developer runs a REPL on one JVM while tests, CI, or the editor use another.