Description
Problem:
In cases where the JAVA_HOME environment variable is not set the `elasticsearch-startup.sh` script tries to determine the java home by looking up the location of the java executable.
However this may yield wrong results as the used output of `JAVA_PATH=$(command -v java)` may just return `/usr` on unix system (when the executable is linked in `/usr/bin/java`.
Steps to reproduce:
on OSX
1. Make sure JAVA_HOME is not set
2. try to run `./elasticsearch-startup.sh` from the demo distribution
Actual result :
Elastic won't start, you may or may not get an error message in the log depending on the exact environment.
Expected result:
It should try to resolve the JAVA_HOME and start, if it can't determine the java home it should just fail telling so.