修改elasticsearch-env:
#新加
export JAVA_HOME=/usr/local/elasticsearch-7.14.0/jdk/ #自己安装的es地址路径
export PATH=$JAVA_HOME/bin:$PATH
#添加的jdk判断
if [ -x "$JAVA_HOME/bin/java" ]; then
JAVA="/usr/local/elasticsearch-7.14.0/jdk/bin/java"
else
JAVA=`which java`
fi