Windows 无法识别 Cassandra 可执行文件 [英] Cassandra executable not recognized in Windows

查看:41
本文介绍了Windows 无法识别 Cassandra 可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过

对我做错了什么有任何想法吗?Powershell 可以看到"的事实cassandra 可以从我的目录树中的任何位置执行,这让我认为 PATH 没有问题.但我不确定会出什么问题:(

解决方案

所以 cassandra 是一个 bash 脚本文件;毫不奇怪,它不能在 Windows 上运行.我也没有在您的 ls 目录输出中看到 cassandra.batcassandra.ps1.

最后一点告诉我您已经下载了 Apache Cassandra 4.0 的候选版本.从 Cassandra 4.0 开始,Windows 支持已被移除,因此 *.bat 和 *.ps1 文件现已消失.

如果您需要在 Windows 上运行,您有两个选择:

  • 您可以下载 Apache Cassandra 3.x 并在 Windows 上本机运行.
  • 您可以使用 WSL(Windows 子系统 Linux)来运行 Cassandra 4.0.

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:

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 :(

解决方案

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.

这篇关于Windows 无法识别 Cassandra 可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆