elasticsearch/elasticsearch — pull request #2216 by karmi (2012-08-30 08:00:56+00:00)
Title: [FIX] Added checking for Java on the system in `bin/elasticsearch`

When Java wasn't installed/available in the system, a confusing "permission denied" error
was diplayed to users:

user@server:/home/ubuntu/elasticsearch-0.19.9# ./bin/elasticsearch -f
./bin/elasticsearch: 122: exec: : Permission denied

This patch fixes the issue by checking for:

a) Java script existence based on the $JAVA environment variable,
b) executability of the Java script

The following [Vagrant](http://vagrantup.com) configuration was used to set up a clean Linux environment:

~~~ruby
Vagrant::Config.run do |config|
config.vm.box = "precise64"

config.vm.provision :shell, :inline => <<-BOOTSTRAP
sudo apt-get install unzip -y
sudo apt-get install vim -y
sudo apt-get install curl -y

wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.zip
unzip elasticsearch-0.19.9.zip
BOOTSTRAP
end
~~~