From fc0bb1520f6b74de834a5bd79440fa78bda913e8 Mon Sep 17 00:00:00 2001 From: Jonathan Ellis Date: Thu, 9 Oct 2014 07:24:19 -0500 Subject: [PATCH] Add sanity check of $JAVA on startup patch by Robert Stupp; reviewed by Michael Shuler for CASSANDRA-7676 --- CHANGES.txt | 1 + bin/cassandra | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 1bef399a95..7deea86405 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.0.11: + * Add sanity check of $JAVA on startup (CASSANDRA-7676) * Schedule fat client schema pull on join (CASSANDRA-7993) * Don't reset nodes' versions when closing IncomingTcpConnections (CASSANDRA-7734) diff --git a/bin/cassandra b/bin/cassandra index a950e0b18d..09fe013c0a 100755 --- a/bin/cassandra +++ b/bin/cassandra @@ -98,6 +98,11 @@ else JAVA=java fi +if [ -z $JAVA ] ; then + echo Unable to find java executable. Check JAVA_HOME and PATH environment variables. > /dev/stderr + exit 1; +fi + # If numactl is available, use it. For Cassandra, the priority is to # avoid disk I/O. Even for the purpose of CPU efficiency, we don't # really have CPU<->data affinity anyway. Also, empirically test that numactl