Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Could not find or load main class org.apache.cassandra.service.CassandraDaemon

I want to try Cassandra. When trying to run Cassandra, writes an error:

Error: Could not find or load main class org.apache.cassandra.service.CassandraDaemon

What's the problem?

Java -version
Java version "1.7.0_67"
Java (TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot (TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

python --version
Python 2.7.8
like image 900
Алексей Сидорин Avatar asked Nov 11 '22 01:11

Алексей Сидорин


1 Answers

You'll get that error when you've downloaded a source distribution of Cassandra but haven't built it or when the CassandraDaemon.class file isn't in your classpath.

For the first problem: You'll need the JDK 1.7 (which you already have) and ant to build C*. Navigate to wherever you've extracted cassandra (I'll use ~/cassandra for this explanation) , Run ant and enjoy the awesome.

For the second, if your classpath is setup incorrectly something has gone wrong in the build process or the classpath has been modified. I'd verify that the classpath is what is expected by displaying it in the startup script (the cassandra executable) by adding echo $CLASSPATH near the bottom of the script (in my case it was line 212 for C* 2.1.0).

P.S. On windows you'll need to set CASSANDRA_HOME before being able to run C*.

like image 155
Lyuben Todorov Avatar answered Nov 15 '22 14:11

Lyuben Todorov