Cassandra and Java 9 - ThreadPriorityPolicy=42 is outside the allowed range

Martin Matak picture Martin Matak · Oct 25, 2017 · Viewed 15.1k times · Source

Very recently I installed JDK 9 and Apache Cassandra from the official site. But now when I start cassandra in foreground, I get this message:

apache-cassandra-3.11.1/bin$ ./cassandra -f

[0.000s][warning][gc] -Xloggc is deprecated. Will use -Xlog:gc:/home/mmatak/monero/apache-cassandra-3.11.1/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.

So far I didn't find any solution for this. Is it maybe possible that Java 9 and Cassandra are not yet compatible? Here is that problem mentioned as well - #CASSANDRA-13107

But I am not sure how to just "remove the flag"? Where is it possible to override or remove this flag?

Answer

wiaylise picture wiaylise · Oct 27, 2017

I had exactly the same issue: Can't start Cassandra (Single-Node Cluster on CentOS7)

If it is an option for you, using Java 8, instead of 9, is the simplest way to solve the issue.