无法找到java可执行文件。检查JAVA_HOME ...同时启动Cassandra

时间:2017-12-31 09:29:52

标签: java linux cassandra-3.0

运行Cassandra

$ apache-cassandra-3.11.1/bin/cassandra -f -R
Unable to find java executable. Check JAVA_HOME and PATH environment variables.

Java设置

java -version
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (Zulu 8.20.0.5-linux64) (build 1.8.0_121-b15)
OpenJDK 64-Bit Server VM (Zulu 8.20.0.5-linux64) (build 25.121-b15, mixed mode)

whereis java
java: /usr/bin/java /usr/lib/java /etc/java /usr/share/java /data/ytbigdata/anaconda3/bin/java

which java
~/anaconda3/bin/java

~/.bash_profile setting
export JAVA_HOME=/data/ytbigdata/anaconda3/bin/java
export PATH=$JAVA_HOME/bin:$PATH

1 个答案:

答案 0 :(得分:0)

Cassandra文档说明"在安装代理的Cassandra节点上,创建文件/ etc / default / datastax-agent并为JAVA_HOME和代理可能需要的任何其他自定义环境变量设置环境变量" https://docs.datastax.com/en/opscenter/6.1/opsc/install/opscCustomVariables_t.html