Setting Up Your Clojure Development Environment

How to set up a current Clojure environment with a JDK, the Clojure CLI, deps.edn, REPL-friendly editors, and a practical first project workflow.

Setting up a Clojure development environment is less about collecting many tools and more about getting four things right:

  • a supported JDK
  • the Clojure CLI
  • an editor with REPL-aware tooling
  • a project shape you can understand and evolve

Older setup guides often make Leiningen sound like the universal first step. That is no longer the best default. The current official toolchain is centered on the Clojure CLI, deps.edn, and, when needed, tools.build.

Start with Java

Clojure runs on the JVM, so the first dependency is a working JDK. The official Clojure downloads page notes that Clojure is compiled to Java 8 compatible bytecode, and newer Java runtimes load it just fine. In practice, most current teams should install a modern LTS JDK rather than hunting for an older version unless a specific project requires one.

The simplest check is:

1java -version

If that command fails, stop there and fix Java first. Nearly every later problem will be noise until the JDK is installed correctly.

Install the Clojure CLI

The Clojure CLI is now the main official entry point for:

  • starting a REPL
  • resolving dependencies
  • running programs
  • invoking aliases and build tasks

Install it from the official getting-started and CLI docs rather than from random blog posts. After installation, verify it works:

1clojure -e "(println :clojure-ok)"

If your setup is correct, this should print :clojure-ok.

Create a Minimal First Project

For a new project, start with a small deps.edn file:

1{:paths ["src" "resources"]
2 :deps {org.clojure/clojure {:mvn/version "1.12.4"}}}

Then add a simple namespace:

1(ns hello.core)
2
3(defn -main []
4  (println "Hello, Clojure"))

You now have a project that is easier to reason about than a large generated template. That matters in Clojure because understanding the REPL, namespace loading, and classpath model is part of becoming productive.

Learn the REPL-Centered Workflow Early

The best Clojure development experience is interactive. The official editors guide is right to emphasize two things:

  • code evaluation against a live REPL
  • structural editing of Lisp forms

That means your editor should not be chosen only by syntax coloring or file browsing. It should support:

  • connecting to a running REPL
  • evaluating forms or namespaces
  • navigating symbols and namespaces
  • linting and feedback during editing

Choose an Editor with Real Clojure Support

The official editors page highlights several strong options.

Emacs

Emacs remains one of the strongest environments for Clojure when paired with CIDER and structural-editing support. It is especially attractive if you value REPL-driven exploration and a deeply customizable editor.

VS Code

VS Code is often the easiest place for newer Clojure developers to start, especially with Calva and the surrounding language-server tooling. It gives a friendlier on-ramp while still supporting the live-evaluation style that makes Clojure productive.

IntelliJ

IntelliJ can be a strong fit for teams that already live in the JVM ecosystem and want a workflow that feels familiar alongside Java or Kotlin work.

The best choice is the one that gets you into a live REPL and keeps you there. A beautiful editor without good Clojure evaluation support will slow down learning.

Understand the Modern Tooling Split

For new work, it helps to separate responsibilities:

  • Clojure CLI + deps.edn: dependency and execution workflow
  • tools.build: explicit artifact creation when you need jars or release tasks
  • Leiningen: still relevant in older codebases, but not the best default teaching path

That distinction matters because many setup problems come from mixing historical tutorials with the current official toolchain.

Common First-Day Tasks

Once Java and the CLI work, a good first-day workflow is:

  1. create deps.edn
  2. create a src directory
  3. start a REPL
  4. load a namespace
  5. evaluate code from the editor
  6. change the code and re-evaluate it

This teaches the actual development loop much faster than spending an hour generating starter projects you do not yet understand.

Practical Troubleshooting

Most setup issues come from a small set of causes:

  • Java is missing or the wrong runtime is being used
  • clojure is not on the shell PATH
  • the editor cannot find the project root or classpath
  • the REPL starts, but the editor is not connected to it
  • a tutorial assumes legacy build-tool behavior that your local toolchain does not use

When debugging environment problems, test the stack in order:

  1. java -version
  2. clojure -e "(println :ok)"
  3. basic REPL start
  4. editor integration
  5. project-specific aliases and build steps

That order avoids wasting time on editor settings before the command-line toolchain is healthy.

A Better Setup Model

    flowchart LR
	    A["Install JDK"] --> B["Install Clojure CLI"]
	    B --> C["Create deps.edn Project"]
	    C --> D["Open REPL-Aware Editor"]
	    D --> E["Connect to Live REPL"]
	    E --> F["Evaluate, Reload, and Iterate"]

The most important thing to notice is that the editor is not the first step and templates are not the center of the flow. The live REPL is.

Key Takeaways

  • Install a current JDK first, then the Clojure CLI.
  • Use deps.edn as the default project entry point for new work.
  • Choose an editor that supports REPL-driven development and structural editing.
  • Learn the interactive workflow before you worry about advanced build automation.
  • Treat Leiningen as an existing-codebase tool, not the universal first step for all new projects.

Ready to Test Your Knowledge?

Loading quiz…
Revised on Thursday, April 23, 2026