首页 > 解决方案 > Cassandra - "The system cannot find the file specified"

问题描述

I have installed Cassandra on Windows 10, and now when I try to run it using "cassandra", I get the following error:

enter image description here

Any ideas?

标签: windowscassandrawindows-10cassandra-3.0

解决方案


After looking at the file it seems, powershell script cassandra-env.ps1 executes following function:

if (Test-Path Env:\JAVA_HOME)
{
    $env:JAVA_BIN = "$env:JAVA_HOME\bin\java.exe"
}
elseif (Get-Command "java.exe")
{
    $env:JAVA_BIN = "java.exe"
}
else
{
    echo "ERROR!  No JAVA_HOME set and could not find java.exe in the path."
    exit
}

I'm not an expert on Cassandra stuff, but if I were you I would run this script and make sure $env:JAVA_BIN is set correctly, and from there I would follow its trail and check ParseJVMInfo function in the conf\cassandra-env.ps1 file which is throwing error in your setup.

Update: Check JAVA_HOME environment variable and see if it is setup such that [JAVA_HOME]\bin\java.exe exists.


推荐阅读