Make the JVM foundation boring and reliable by choosing a supported JDK, aligning terminal and editor settings, and verifying the same Java runtime across Clojure tools and Java builds.
Clojure runs on the JVM, so your REPL is just a JVM process. If you already have a working JDK for Java development, you may be done. If not, install a supported JDK and make sure your shell and tools agree on which one is active.
java -version reports the JDK you expect.JAVA_HOME (if you use it) points to the same installation.| Check | Why it matters in Clojure | Common Java-team failure |
|---|---|---|
| Terminal JDK | Clojure CLI, Leiningen, test runners, and scripts often start from the shell | IDE uses one JDK while terminal commands use another |
JAVA_HOME |
Some build tools and plugins still consult it | It points to an older JRE or removed installation |
| Classpath behavior | Clojure loads namespaces and dependencies through JVM classpath rules | The app works in the IDE but cannot find code from the REPL |
| Certificates/proxy | Dependency downloads use JVM/network settings | Corporate proxy breaks dependency resolution |
Practical rule: avoid “it works in my IDE but not in the terminal” by verifying everything from the terminal first.
Once the JVM is stable, the rest of the Clojure setup becomes straightforward.