$ 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=`\
See this CASSANDRA-11716 issue. The solution posted there worked for me.
To resolve this problem I changed $JAVA_HOME environment variable to the path I found it from:
System Preferences -> Java -> java (tab in Java Control Panel) -> View -> Path
I had two version of java and the default one was the old version of java.
There appears to be a newer issue now that Java 7 update 101 has been released. I installed this version which broke Cassandra:
yum install java-1.7.0-oracle-1.7.0.101-1jpp.1.el7.x86_64
Installing a previous version (update 99) fixed the issue:
yum install java-1.7.0-oracle-1.7.0.99-1jpp.1.el7.x86_64
I'm guessing somewhere in the cassandra startup script a Regex is written for 2 characters in the update version, not 3.
Nothing above worked for me.I was trying to run cassandra with supervisor and was getting java error.So I figured out that I had to just set java path in cassandra.in.sh. I just had to set JAVA_HOME=/usr/local/jdk1.8.0_171 and save it and this worked for me.
I have faced a similar issue when installing DSE 4.6 on Linux. Issue is resolved when you set JAVA_HOME (as root) to the directory where JRE 1.7.x installed.
This is caused by a bug in Cassandra: https://issues.apache.org/jira/browse/CASSANDRA-11661