Compile Apache Cassandra from sources

Prerequisites

Java

$ cat /opt/java/load_jdk11.sh 
#! /bin/bash

export JAVA_HOME=/opt/java/jdk-11
export PATH=${JAVA_HOME}/bin:${PATH}

$ java -version
java version "11" 2018-09-25
Java(TM) SE Runtime Environment 18.9 (build 11+28)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11+28, mixed mode)

Ant

A decently recent version would do it:

$ ant -version
Apache Ant(TM) version 1.10.5 compiled on July 10 2018

How to proceed from here

Download the code (will take some time)

$ git clone https://github.com/apache/cassandra.git
  [....]
$ cd cassandra

Compile the code (will take some more)

$ ant -Duse.jdk11=true
  [....]
BUILD SUCCESSFUL

If everything went well, you should be now able to run your nice Cassandra instance with Java 11:

$ ./bin/cassandra


[cassandra] [git] [java]