[756]could not find java in JAVA_HOME or bundled at D:\soft\elasticsearch-7.4.2\jdk

启动elasticsearch-7.4.2,

运行bin目录下的elasticsearch.bat文件(此文件是批处理文件,在Windows下双击也可以,但是双击之后,如果出现错误,我们是看不见的,所以此处不建议双击)

#进入cmd控制台,进入elasticsearch.bat文件所在目录,然后运行如下命令
elasticsearch.bat

浏览器访问http://localhost:9200/,如果出现如下则服务启动成功,否则按照错误信息,去查找

{
  "name" : "node-1",
  "cluster_name" : "my-application",
  "cluster_uuid" : "tE18H2eXSimOzKKgAyZMtw",
  "version" : {
    "number" : "6.4.2",
    "build_flavor" : "default",
    "build_type" : "zip",
    "build_hash" : "04711c2",
    "build_date" : "2018-09-26T13:34:09.098244Z",
    "build_snapshot" : false,
    "lucene_version" : "7.4.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

错误信息

D:\soft\elasticsearch-7.4.2\bin>elasticsearch.bat
"could not find java in JAVA_HOME or bundled at D:\soft\elasticsearch-7.4.2\jdk"

主要原因是你本地设置了环境变量JAVA_HOME,把环境变量JAVA_HOME改个名字或去掉,就会使用自带的jdk,再次执行,就ok了。

参考:https://alvin.onloading.cn/2018/10/06/elasticsearch-install/

你可能感兴趣的:(异常)