title: Error: Could not find or load main class, Cassandra
body: <p>I am trying to build Casandra project on a Centos server. I downloaded the file from here.</p>
  
  <p><a href="http://apache.bilkent.edu.tr/cassandra/2.0.6/" rel="noreferrer">http://apache.bilkent.edu.tr/cassandra/2.0.6/</a></p>
  
  <p>Here is the README.txt file</p>
  
  <pre><code>This short guide will walk you through getting a basic one node cluster up
  and running, and demonstrate some simple reads and writes.
  
    * tar -zxvf apache-cassandra-$VERSION.tar.gz
    * cd apache-cassandra-$VERSION
    * sudo mkdir -p /var/log/cassandra
    * sudo chown -R `whoami` /var/log/cassandra
    * sudo mkdir -p /var/lib/cassandra
    * sudo chown -R `whoami` /var/lib/cassandra
  
  Note: The sample configuration files in conf/ determine the file-system 
  locations Cassandra uses for logging and data storage. You are free to
  change these to suit your own environment and adjust the path names
  used here accordingly.
  
  Now that we're ready, let's start it up!
  
    * bin/cassandra -f
  </code></pre>
  
  <p>As README.txt file suggested I followed these instructions as adapting to my case (I am not root). </p>
  
  <pre><code>tar -zxvf apache-cassandra-2.0.6-src.tar.gz
  cd apache-cassandra-2.0.6-src
  mkdir -p var/log/cassandra
  chown -R `whoami` var/log/cassandra
  mkdir -p var/lib/cassandra
  chown -R `whoami` var/lib/cassandra
  </code></pre>
  
  <p>Since I am not root on the server, I can not create my files under <code>/var</code> folder. So, I created new folder <code>var</code> under <code>apache-cassandra-2.0.6-src</code> and put my <code>lib</code> and <code>log</code> files there. Then I followed next instructions from README.txt file.</p>
  
  <pre><code>bin/cassandra -f
  </code></pre>
  
  <p>However whatever I tried it is no good, I always get this error.</p>
  
  <pre><code>Error: Could not find or load main class org.apache.cassandra.service.CassandraDaemon
  </code></pre>
  
  <p>How can I fix this problem? </p>
  
  <p>My java version</p>
  
  <pre><code>java -version
  
  java version "1.7.0_51"
  OpenJDK Runtime Environment (rhel-2.4.4.1.el6_5-x86_64 u51-b02)
  OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
  </code></pre>
  
  <p><strong>EDIT:</strong>
  As an extra informaiton, I tried this instructions on my pc, too. Exactly same thing with README.txt file using <code>sudo</code> and <strong>it worked.</strong></p>