$ cassandra
Cassandra 2.0 and later require Java 7 or later.
OK, what\'s going on in that part of the init script?
java_ver_output=`\
I got the same error message when trying to start Cassandra. But I notised that I only got the error when starting Cassandra as root. It worked when I started Cassandra as my local user.
It turned out that java only was configured for my local user:
$ java -version
java version "1.7.0_60"
Java(TM) SE Runtime Environment (build 1.7.0_60-b19)
Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)
$ sudo java -version
sudo: java: command not found
This fixed the problem:
Tell the system that you have JRE installed (update usr/local/java/jre1.7.0_60/bin/java to your current path):
$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jre1.7.0_60/bin/java" 1
Set the new JRE as default:
$ sudo update-alternatives --set java /usr/local/java/jre1.7.0_60/bin/java
Now java is installed for root and Cassandra can be started as root without the error message.
Per documentation: http://wiki.helioviewer.org/wiki/Apache_Cassandra_Installation
Set JAVA_HOME
Make sure JAVA_HOME is set: echo $JAVA_HOME
So make sure JAVA_HOME
is pointing to /path/to/jdk7