Elasticsearch启动Java环境错误

报错提示如下
es@MEPRDAPP01:/es/opt/elastic/elasticsearch-7.14.1> sh start.sh 
warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME
Future versions of Elasticsearch will require Java 11; your Java version from [/usr/local/java/jre] does not meet this requirement. Consider switching to a distribution of Elasticsearch with a bundled JDK. If you are already using a distribution with a bundled JDK, ensure the JAVA_HOME environment variable is not set.
Linux环境使用的JDK
es@MEPRDAPP01:/es/opt/elastic/elasticsearch-7.14.1> java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)
修改启动脚本\bin\elasticsearch-env,新增一行ES的JDK路径
# use elasticsearch jdk
ES_JAVA_HOME="/es/opt/elastic/elasticsearch-7.14.1/jdk"

在这里插入图片描述

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐