Not able to run cqlsh command in apache cassandra

Viewed 41

I have installed apache cassandra and i checked my java versions as well.

java -version
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)

However, after going into bin file and trying to run ./cqlsh or ./cassandra -f I am getting this error:

bin % .**/cassandra -f
[0.003s][warning][gc] -Xloggc is deprecated. Will use -Xlog:gc:./../logs/gc.log instead.
intx ThreadPriorityPolicy=42 is outside the allowed range [ 0 ... 1 ]
Improperly specified VM option 'ThreadPriorityPolicy=42'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

1 Answers

Improperly specified VM option 'ThreadPriorityPolicy=42'

-XX:ThreadPriorityPolicy=42 is specified in the conf/jvm.options file. That file was built with flags specific to Java 8, because that is the highest level of the JDK supported by Apache Cassandra 3.

There are two options here:

  • Upgrade to Cassandra 4.0, which will run on Java 11.
  • Downgrade the JDK to (the latest patch of) Java 8.
Related