Choose and install a supported JDK for Clojure development without getting distracted by vendor debates, then verify that your shell, editor, and build tools use the same runtime.
If java -version or javac -version fails, install a JDK before installing Clojure. Clojure is hosted on the JVM, and the official Clojure tools expect Java to be available through PATH, JAVA_HOME, or a Java command override.
For most Java engineers, the decision is straightforward: install a current Long-Term Support (LTS) JDK unless a workplace project requires a specific version.
| Decision | Practical guidance |
|---|---|
| Java version | Use a current LTS version for new learning and projects; respect project constraints in existing codebases |
| Distribution | Any standards-compliant JDK distribution is fine for Clojure |
| Architecture | Match your operating system and CPU architecture, especially on Apple Silicon or ARM Linux |
| Install method | Prefer the method your team or package manager can reproduce |
| CI parity | Make local Java match CI when possible |
Official Clojure release guidance currently lists Java 8 as the minimum and recommends Java 25. The installation guide also notes support for Java LTS releases and says any Java distribution can work, including OpenJDK-based builds such as Temurin.
Avoid hand-copying random JDK folders into a place nobody remembers. Prefer a repeatable source:
| Platform | Good approach | What to avoid |
|---|---|---|
| macOS | Homebrew, vendor installer, or a version manager your team uses | Mixing several installers without documenting which one wins |
| Linux | Distribution packages, vendor packages, container base image, or team-standard version manager | Manually unpacking archives into arbitrary locations without tracking upgrades |
| Windows | Vendor MSI/installer, package manager, or team endpoint tooling | Installing only a JRE when development tools are needed |
| CI | Explicit setup step or base image | Relying on whatever Java happens to be preinstalled |
The best install is not the fanciest one. It is the one your future teammate can reproduce from the README.
Open a new terminal and run:
1java -version
2javac -version
Then verify that Clojure tooling can find Java later:
1clj -h
If clj -h works after the Clojure CLI is installed, the CLI found a usable Java executable. If it fails, return to Java selection before debugging Clojure dependencies.
Many Java teams run more than one JDK because old services, current services, and CI pipelines do not all move together. That is fine, but make selection explicit.
Use one of these patterns:
Avoid relying on global machine state when a project has a real Java version requirement.
Clojure does not just “use Java” at runtime. The Clojure CLI computes classpaths, downloads Maven artifacts, starts JVM processes, and runs REPLs. A Java install is ready for Clojure only when these are true:
| Requirement | Why it matters |
|---|---|
java is available |
The REPL and Clojure programs launch on the JVM |
javac is available |
You have a full JDK and can compile Java interop helpers if needed |
| TLS/certificates work | Maven dependencies can download |
| Terminal and editor agree | REPL behavior matches command-line behavior |
| CI agrees | Local success predicts pipeline success |