Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME

时间:2022-11-02 23:05:59

启动elasticsearch时报错 “Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME”

原因:elasticsearch安装的根目录权限不是当前用户所拥有的权限。

解决办法:我的安装位置为 /usr/local/elasticsearch-5.0.0

bd_gj@all2: cd  /usr/local

bd_gj@all2: ls -l

drwxr-xr-x  7 root root 4096 Nov  3 15:35 elasticsearch-5.0.0 (此时elasticsearch的安装根目录权限为root:root)

bd_gj@all2:   /usr/local$ sudo chown -R bd_gj:bd_gj elasticsearch-5.0.0/

bd_gj@all2: ls -l

drwxr-xr-x  7 bd_gj  bd_gj4096 Nov  3 15:35 elasticsearch-5.0.0

然后再启动就没问题了