title: Java error: Bad version number in .class file error when trying to run Cassandra on OS X
body: <p>I am trying to get Cassandra to work on OS X. When I run <code>bin/cassandra</code>, I get the following error:</p>
  
  <pre><code>~/apache-cassandra-incubating-0.4.1-src &gt; bin/cassandra -f
  Listening for transport dt_socket at address: 8888
  Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
  </code></pre>
  
  <p>From what I could determine by searching, this error is related to incompatible versions of Java. However, as far as I can tell, I have the latest version of Java:</p>
  
  <pre><code>    ~/apache-cassandra-incubating-0.4.1-src &gt; java -version
      java version "1.6.0_13"
      Java(TM) SE Runtime Environment (build 1.6.0_13-b03-211)
      Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-83, mixed mode)
      ~/apache-cassandra-incubating-0.4.1-src &gt; javac -version
      javac 1.6.0_13
      ~/Downloads/apache-cassandra-incubating-0.4.1-src &gt; echo $JAVA_HOME
      /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
  </code></pre>
  
  <p>Any ideas on what I'm doing wrong?</p>