Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What version of Java does Cassandra 3 require

Tags:

cassandra

The recommended version of Java for Cassandra 2.0 was Java 7. But which version is recommended or required for Cassandra 3 (specifically, version 3.5)?

Some information suggests that Java 7 or Java 8 are required; that is, that Java 7 is still OK:

  • The Cassandra Wiki says:

Cassandra requires the most stable version of Java 7 or 8

  • The change log for Cassandra 3.5 does not mention changing the required JRE. It does have a change (CASSANDRA-7028) to "Allow compilation in java 8". But allow is not the same as require.
like image 311
Raedwald Avatar asked Feb 07 '23 23:02

Raedwald


1 Answers

Cassandra 3.0+ requires Java 8.

  • The cassandra-env.sh script, used by the cassandra shell script, examines the JVM version and refuses to run if the JVM version is before 1.8.
  • If you try to run code directly using one of the classes of the cassandra-all.jar using a Java 7 environment you will get a java.lang.UnsupportedClassVersionError complaining of Unsupported major.minor version 52.0.
  • The META-INF/MANIFEST.MF file in the JAR indicates it was compiled using a Java 8 compiler: Created-By: 1.8.0_45-b14 (Oracle Corporation).
  • The Datastax announcement about Cassandra 3 says that it requires Java 8.

In conclusion, the Cassandra Wiki is wrong and the Cassandra change log is misleading.

like image 105
Raedwald Avatar answered Feb 19 '23 07:02

Raedwald