I'm trying to setup Elasticsearch.
Everything's running fine on Ubuntu 14.10 but when I upgrade OS to Ubuntu 15.04, it always failed to start Elasticsearch as a service. (but I can still run it directly by command: sudo /usr/share/elasticsearch/bin/elasticsearch -Des.default.config=...
)
The logs say that elasticsearch can't find any executable java binary.
systemd[1]: Starting Starts and stops a single elasticsearch instance on this system...
sudo[4906]: pam_unix(sudo:session): session closed for user root
elasticsearch[4912]: Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME...
systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
systemd[1]: Unit elasticsearch.service entered failed state.
systemd[1]: elasticsearch.service failed.
I thought the environment variables might be different among users so I tried to add JAVA_HOME in /etc/environment
and /etc/default/elasticsearch
but it didn't work though.
So any ideas what might be the problem?