From 9ab6e01f4d1a386f3e40f02abe9862ad10fe24c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Carvalho?= Date: Thu, 17 Sep 2015 10:34:36 -0300 Subject: [PATCH] Adds a validation for plugins script to check if java is set This does the same validation as in elasticearch bin script --- distribution/src/main/resources/bin/plugin | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/distribution/src/main/resources/bin/plugin b/distribution/src/main/resources/bin/plugin index d2d112c2f55..0eef371c2da 100755 --- a/distribution/src/main/resources/bin/plugin +++ b/distribution/src/main/resources/bin/plugin @@ -65,6 +65,11 @@ else JAVA=`which java` fi +if [ ! -x "$JAVA" ]; then + echo "Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME" + exit 1 +fi + # real getopt cannot be used because we need to hand options over to the PluginManager while [ $# -gt 0 ]; do case $1 in