【发布时间】:2020-08-17 02:24:43
【问题描述】:
虽然我的环境变量是正确的,但我无法使用“cassandra -f”启动 cassandra。我使用的是 Windows 10 机器。
我收到以下错误!
PS C:\WINDOWS\system32> cassandra -f
*---------------------------------------------------------------------* *---------------------------------------------------------------------* WARNING! Automatic page file configuration detected. It is recommended that you disable swap when running Cassandra for performance and stability reasons. *---------------------------------------------------------------------* *---------------------------------------------------------------------* Exception calling "Start" with "0" argument(s): "The system cannot find the file specified" At C:\cassandra\conf\cassandra-env.ps1:212 char:5 + $p.Start() | Out-Null + ~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : Win32Exception Exception calling "WaitForExit" with "0" argument(s): "No process is associated with this object." At C:\cassandra\conf\cassandra-env.ps1:213 char:5 + $p.WaitForExit() + ~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : InvalidOperationException You cannot call a method on a null-valued expression. At C:\cassandra\conf\cassandra-env.ps1:214 char:5 + $stderr = $p.StandardError.ReadToEnd() + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\cassandra\conf\cassandra-env.ps1:218 char:9 + if ($stderr.Contains("Error")) + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull You cannot call a method on a null-valued expression. At C:\cassandra\conf\cassandra-env.ps1:231 char:5 + $sa = $stderr.Split("""") + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull Cannot index into a null array. At C:\cassandra\conf\cassandra-env.ps1:232 char:5 + $env:JVM_VERSION = $sa[1] + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : NullArray You cannot call a method on a null-valued expression. At C:\cassandra\conf\cassandra-env.ps1:234 char:9 + if ($stderr.Contains("OpenJDK")) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull Cannot index into a null array. At C:\cassandra\conf\cassandra-env.ps1:247 char:5 + $pa = $sa[1].Split("_") + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : NullArray Cannot index into a null array. At C:\cassandra\conf\cassandra-env.ps1:248 char:5 + $subVersion = $pa[1] + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : NullArray *---------------------------------------------------------------------* *---------------------------------------------------------------------* WARNING! Detected a power profile other than High Performance. Performance of this node will suffer. Modify conf\cassandra.env.ps1 to suppress this warning. *---------------------------------------------------------------------* *---------------------------------------------------------------------* You cannot call a method on a null-valued expression. At C:\cassandra\conf\cassandra-env.ps1:406 char:9 + if ($env:JVM_VERSION.CompareTo("1.8.0") -eq -1 -or [convert]::ToI ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull Exception calling "Start" with "0" argument(s): "The system cannot find the file specified" At C:\cassandra\bin\cassandra.ps1:251 char:9 + $p.Start() | Out-Null + ~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : Win32Exception Exception calling "WaitForExit" with "0" argument(s): "No process is associated with this object." At C:\cassandra\bin\cassandra.ps1:253 char:9 + $p.WaitForExit() + ~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : InvalidOperationException
【问题讨论】:
-
Cassandra 通常不在 Windows 上运行。它曾一度有一些 Windows 支持,但尚未得到维护。您要启动哪个版本?
-
从外观上看,它在尝试验证您的 JRE 时失败了。你有安装Java吗?
java -version的输出是什么? -
@Aaron:我正在运行 JDK 12.0.1