Cassandra executable not recognized in Windows

9k views Asked by At

I'm trying to download and install Cassandra on Windows 10 by downloading and extracting the tar file. I have made sure to initialize new environment variables CASSANDRA_HOME and I have also updated the PATH variable to include the bin subdirectory (you can see it as the last entry in %PATH%):

C:\Users\jason>echo %CASSANDRA_HOME%
C:\apache-cassandra\

C:\Users\jason>echo %PATH%
C:\Program Files\Amazon Corretto\jdk11.0.9_12\bin;C:\Python39\Scripts\;C:\Python39\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Users\jason\code\aspectj1.9\bin;C:\Program Files\MiKTeX\miktex\bin\x64\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\MongoDB\Server\4.4\bin;C:\Program Files\MongoDB\Tools\100\bin;C:\Program Files\nodejs\;C:\Users\jason\AppData\Local\Programs\mongosh\;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\apache-cassandra\bin;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\jason\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3\bin;;C:\Users\jason\AppData\Local\atom\bin;C:\Users\jason\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\JetBrains\PyCharm 2020.2.3\bin;;C:\Users\jason\code\aspectj1.9\bin;C:\Program Files\MongoDB\Server\4.4\bin;C:\Program Files\MongoDB\Tools\100\bin;C:\Users\jason\AppData\Roaming\npm;C:\Users\jason\AppData\Local\Programs\mongosh\;C:\apache-cassandra\bin;

C:\Users\jason>cd %CASSANDRA_HOME%/bin


C:\apache-cassandra\bin>ls
cassandra        cqlsh     debug-cql  sstableloader  sstableupgrade  sstableverify
cassandra.in.sh  cqlsh.py  nodetool   sstablescrub   sstableutil     stop-server

C:\apache-cassandra\bin>cassandra
'cassandra' is not recognized as an internal or external command,
operable program or batch file.

C:\apache-cassandra\bin>cassandra.bat
'cassandra.bat' is not recognized as an internal or external command,
operable program or batch file.

C:\apache-cassandra\bin>./cassandra
'.' is not recognized as an internal or external command,
operable program or batch file.

C:\apache-cassandra\bin>./cassandra.bat
'.' is not recognized as an internal or external command,
operable program or batch file.

Here's what I've tried so far:

  1. Updating both user and system environment variables.
  2. Trying through both cmd and Powershell.
  3. Trying both as a regular user and an administrator.
  4. Followed this post's advice, where the accepted answer seems to imply that whitespace in the directory path can cause issues; there is no whitespace in my directory path.

The only progress that I've had is through powershell, where just running cassandra from anywhere in the system prompts me to select a program to open the executable, but from there on out I'm stuck:

Open Cassandra with an Application

Any ideas on what I'm doing wrong? The fact that powershell can "see" the cassandra executable from anywhere in my directory tree makes me think that there are no problems with PATH. But I'm not sure what could be going wrong :(

2

There are 2 answers

2
Aaron On BEST ANSWER

So cassandra is a bash script file; no surprise that doesn't run on Windows. I also don't see cassandra.bat or cassandra.ps1 in your ls directory output.

That last point tells me that you have downloaded the release candidate for Apache Cassandra 4.0. Windows support was removed as of Cassandra 4.0, thus the *.bat and *.ps1 files are now gone.

If you need to run on Windows you have two options:

  • You can download Apache Cassandra 3.x and run that natively on Windows.
  • You can use the WSL (Windows Subsystem Linux) to run Cassandra 4.0.
0
Pratik Patharkar On

Due to lack of maintenance and testing, Cassandra 4.0 and its further versions will no longer be supported on WINDOWS Click here to check.

If you still want to use Cassandra, opt anything out of these:

1> Deploy Cassandra in a VM using software like VirtualBox

2> Deploy Cassandra using Docker link

3> Deploy k8ssandra.io link