尽管设置了JAVA_HOME,但 JAVA 不在路径中
2022-09-03 08:30:00
我已经在/etc/profile中设置了所有需求变量,但是当启动elasticsearch时,它仍然没有找到Java。我如何设置环境变量。这是我的 /etc/个人资料
PATH=$PATH:$HOME/bin
APPLICATIONS=$HOME/Applications
JAVA_HOME=$APPLICATIONS/jdk1.7.0_79
PATH=$JAVA_HOME/bin:$PATH
export APPLICATIONS
export JAVA_HOME
export PATH
命令输出
[root@87500e63467f Applications]# echo $PATH
/root/Applications/jdk1.7.0_79/bin:/root/Applications/jdk1.7.0_79/bin:/root/Applications/jdk1.7.0_79/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin:/root/bin
[root@87500e63467f Applications]# echo $JAVA_HOME
/root/Applications/jdk1.7.0_79
[root@87500e63467f Applications]# java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
error: "Read-only file system" setting key "vm.max_map_count"
Starting elasticsearch: which: no java in (/sbin:/usr/sbin:/bin:/usr/bin)
Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME
[FAILED]
在错误中,它说“”开始弹性搜索:其中:没有java在(/sbin:/usr/sbin:/bin:/usr/bin)“”,这意味着真的java不在那个路径中,但是当我回显$PATH时,它表明java在路径中?