Getting Started

This page walks you through setting up a Cassandra development environment from scratch.

Prerequisites

You need the following installed before building Cassandra:

  • Java Development Kit (JDK) — JDK 11 or 17 for building; JDK 17 or 21 for running Cassandra 6. Download from Eclipse Adoptium or your preferred vendor.

  • Apache Ant — Cassandra uses Ant as its build system. Install from ant.apache.org or via your package manager.

  • Git — git-scm.com

  • Python 3 — Required for running distributed tests (dtests) and cqlsh.

Verify your Java toolchain before you build:

java -version
javac -version

Clone the Repository

Fork the Apache Cassandra repository on GitHub, then clone your fork:

git clone https://github.com/<your-username>/cassandra.git
cd cassandra

Add the upstream remote so you can pull future changes:

git remote add upstream https://github.com/apache/cassandra.git

Initialize Submodules

Cassandra uses git submodules for dependencies such as Accord. Initialize them after cloning:

git submodule update --init --recursive
When starting a development branch for a JIRA ticket, use the helper script to create matching branches across submodules: .build/sh/development-switch.sh --jira CASSANDRA-<number> (Source: CONTRIBUTING.md)

Build Cassandra

Build the project with Ant:

ant

This compiles the source, downloads dependencies, and produces build artifacts. The first build usually takes about 5-10 minutes on a laptop; later builds are often 1-2 minutes.

Expected success output ends with something like:

BUILD SUCCESSFUL

To verify everything compiled correctly:

ant jar build-test

Expected success output:

BUILD SUCCESSFUL
Total time: ...

Run a Smoke Test

Run a single unit test to verify your build:

ant test -Dtest.name=org.apache.cassandra.utils.UUIDTest

For a single test class, a successful run typically ends with:

BUILD SUCCESSFUL
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

Or run the full unit test suite:

ant test

The full unit suite takes much longer than a smoke test; use it when you are validating a wider change, not for every edit.

See Testing for comprehensive guidance on all test types.

Next Steps

This page provides the essential getting-started workflow. For build helper scripts and Docker-based builds, see the .build/README.md in the Cassandra repository.