ES启动时候报错:future versions of Elasticsearch will require Java 11; your Java version from [/data/jdk1.8.0_111/jre] does not meet this requirement

es启动时候会使用环境变量的jdk,在不改变现有环境变量的情况下使用自带的openjdk,需要执行以下步骤:

es版本:7.5.1

自带的openjdk版本:13.0.1

  1. 修改elasticsearch-env内容,截图如下:

  2. 重启ES,成功之后则忽略以下步骤:
  3. 如果重启发现还不成功,报这个错

    OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

    修改./config/jvm.options 文件夹内容

  4. 使用非root用户启动ES,则成功