Unable to run Cassandra 4.0.7 using Java 17 - cassandra

Trying to install cassandra 4.0.7 on my laptop. When i type cassandra in cmd it simply exits.
Used gitbash for running the cassandra. Here the output looks like.
enter image description hereerror
removed UseConcMarkSweepGC from the jvm11-server.options file. But not working.

Cassandra 4.0.7 does not support java17. This support is expected for Cassandra 5.x (late 2023 as of today). Please downgrade to Java 11 with tools like jenv
Check the current status here
https://issues.apache.org/jira/browse/CASSANDRA-16895

Apache Cassandra 4.x does not support Java 17.
Support for Java 11 was added in Cassandra 4.0 (CASSANDRA-9608, CASSANDRA-16894). At this point, Cassandra 4.x releases support both Java 8 and Java 11. Note that C* 3.0 + 3.11 (and older releases) only support Java 8.
Support for Java 17 LTS will be added in a future release of Cassandra (CASSANDRA-16895). When that does land, support for Java 8 will be dropped paving the way for just Java 11 + Java 17. Cheers!

Related

Why can't I run CassandraDB on Windows 10 with the latest Java installed?

When I try to start up Cassandra DB under windows 10, It complains about the Java version:
Cassandra 3.0 and later require Java 8u40 or later.
I believe I have the latest Java installed:
java --version
java 13.0.2 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
I've installed Apache Cassandra 3.11.9 (the open source version not the Datastax version).
Why doesn't Cassandra recognize this version of Java? Do I need to install a different version of Java to get this working?
Yes, you need to install Java 8 to run Cassandra 3.11 - it will not work with Java 13 (yes, I understand that error message isn't clear). Support for Java > 8 was added only to Cassandra 4.0, that is currently in beta.
Also, on Windows it would be easier to use Docker to run Cassandra - there are different difficulties with running Cassandra on Windows.

Getting some weird issue trying to run Cassandra on Windows 10

I am trying to install Cassandra. I followed the instructions here.
https://www.youtube.com/watch?v=EEXtVn3zAqc
I had Java 14 and I when I tried to run Cassandra I got a message saying that Java 8 or 11 needs to be installed. So, I got Java 11 from the link below.
https://www.oracle.com/java/technologies/javase-jdk11-downloads.html
I downloaded Cassandra and added the path to Environment Variables. I added the Java path to Environment Variables too. Now, I navigate to the Cassandra path in the Command Prompt and type 'cassandra.bat -f' and I get this message: 'Cassandra 4.0 requires either Java 8 (update 151 or newer) or Java 11 (or newer). Java 11.0.8 is not supported.' I already have Java 11; I got it just for Cassandra. I am on Windows 10. How can I make this work?

Error installing Cassandra on Mac with Java 13

I am using macOS Mojave My Java version is 13.0
I am a beginner in Cassandra please help me to fix this I read lot of post regarding this error but all are old not working with the current version
webz$ java -version
java version "13.0.1" 2019-10-15
Java(TM) SE Runtime Environment (build 13.0.1+9)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
cassendra error :-
Webzs-MacBook-Pro:~ webz$ cassandra
Webzs-MacBook-Pro:~ webz$ [0.001s][warning][gc] -Xloggc is deprecated. Will use -Xlog:gc:/usr/local/cassandra/bin/../logs/gc.log instead.
Unrecognized VM option 'UseParNewGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
In the jvm.options file of Cassandra, check if this is enabled.
-XX:+UseParNewGC
If yes, then you can comment that and replace with this
-XX:+UseG1GC
This is because support for UseParNewGC has been disabled in Java 10.
https://bugs.openjdk.java.net/browse/JDK-8151084
You may run into other issues also because of your java version as released versions of Cassandra support only Java 8. The support for higher versions will be in Cassandra 4.0 but that isn't released yet.
As it states in the Installation prerequisites, Cassandra 3.x (or earlier versions) only work with Java 8.
Cassandra 4.0.2 added full support for Java 11 only recently (CASSANDRA-16894). This means that C* 4.x will work with either Java 8 or Java 11.
Cassandra will not work with Java 13. For what it's worth, we are working on supporting Java 17 LTS in the next major release of Cassandra (CASSANDRA-16895). Cheers!

Cassandra does not start on Java 10

I have a brand new Windows 10 Home installation, with a brand-new installation of JDK 10.0.1 (which is what Oracle recommended when I went to the JDK download site.) I just now downloaded Cassandra 3.11.2, un-tar'd it, and put the bin directory on my classpath.
When I attempt to start Cassandra using the cassandra -f command, I get this error:
PS C:\javatools> cassandra -f
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
WARNING! Automatic page file configuration detected.
It is recommended that you disable swap when running Cassandra
for performance and stability reasons.
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
Failed 64-bit check. Re-running to get version from 32-bit
*---------------------------------------------------------------------*
*---------------------------------------------------------------------*
Cassandra 3.0 and later require Java 8u40 or later.
Java 10 is clearly "Java 8 rel 40 or later". I verified that I was, in fact, running the version of Java I thought I was:
PS C:\javatools> java -version
java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
How can I get Cassandra to recognize that I do, in fact, have "Java 8u40 or later"?
Cassandra does not support any Java release newer than Java 8.
References are as follows:
declined bug report against Java 9: CASSANDRA-9608
declined bug report against Java 10: CASSANDRA-14446
Furthermore, even though the documentation does indicate it's a "work in progress", it does indicate the following on the Getting Started page:
Prerequisites
The latest version of Java 8, either the Oracle Java Standard Edition
8 or OpenJDK 8. To verify that you have the correct version of java
installed, type java -version.
While it doesn't explicitly say "Java 9 and newer are not supported", this is apparently supposed to be inferred from this indicator.
Finally, the misleading error message appears to be a wontfix item.
I've managed to run cassandra 3.11.3 on java-11-openjdk-amd64 on localhost (ubuntu 18.04).
(Strangely, java -version shows openjdk version "10.0.1" 2018-04-17)
I tweaked a lot in jvm.options, because many gc options are not supported anymore, and ThreadPriorityPolicy could not be set to 42. (last thing is most annoying: it was really good compaction threads were low priority).
Also, to run nodetool I have to specify jvm 1.8 by JAVA_HOME.

What version of Java does Cassandra 3 require

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.
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.

Resources