Minu
Minu

Reputation: 47

Unrecognized VM option 'UseParNewGC' Error: Could not create the Java Virtual Machine. while setting apache-cassandra-3.11.8

I am getting this error messege when I am typing cassandra on my cmd.

WARNING! Powershell script execution unavailable.
   Please use 'powershell Set-ExecutionPolicy Unrestricted'
   on this user-account to run cassandra with fully featured
   functionality on this platform.
Starting with legacy startup options
Starting Cassandra Server
Unrecognized VM option 'UseParNewGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

my java version is

java version "15" 2020-09-15
Java(TM) SE Runtime Environment (build 15+36-1562)
Java HotSpot(TM) 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)

I am using windows 10 and both are installed on C drive. Can anyone help me to solve this?

Upvotes: 2

Views: 7042

Answers (2)

Shreyansh Jain
Shreyansh Jain

Reputation: 412

For anyone facing this issue in Mac OS, make sure that Cassandra version and Java version you're using are compatible. I was using Java 17 and changed it to Java 11 for cassandra 4.0.12

Upvotes: 0

Alex Ott
Alex Ott

Reputation: 87119

You have 2 issues:

  1. Windows clearly says you to execute powershell Set-ExecutionPolicy Unrestricted to be able to run the startup script
  2. You're using Java 15 that is not supported by Cassandra 3.11 - it works only with Java 8, so you need to downgrade Java

P.S. I would recommend to run Cassandra in Docker on Windows - you'll avoid many problems, as Windows isn't very actively supported platform for Cassandra, and its support could be removed in the future.

Upvotes: 4

Related Questions