编辑bin/elasticsearch
可以看到elasticsearch使用环境变量JAVA_HOME中配置的jdk:if [ -x "$JAVA_HOME/bin/java" ]; then JAVA="$JAVA_HOME/bin/java"else JAVA=`which java`fi
直接修改为指定好的jdk即可JAVA="/usr/java/jdk1.8.0_111/bin/java"