From 2ea77782a16512c9d1d6f1da4f7b902468c96305 Mon Sep 17 00:00:00 2001 From: David Pilato Date: Thu, 24 May 2012 10:28:40 +0300 Subject: [PATCH] Parse elasticsearch.in.sh before setting JAVA dir as we could define JAVA_HOME in elasticsearch.in.sh --- bin/elasticsearch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/elasticsearch b/bin/elasticsearch index b447011d53c..be19c44a5c7 100755 --- a/bin/elasticsearch +++ b/bin/elasticsearch @@ -68,12 +68,6 @@ ES_HOME=`dirname "$SCRIPT"`/.. ES_HOME=`cd "$ES_HOME"; pwd` -if [ -x "$JAVA_HOME/bin/java" ]; then - JAVA=$JAVA_HOME/bin/java -else - JAVA=`which java` -fi - # If an include wasn't specified in the environment, then search for one... if [ "x$ES_INCLUDE" = "x" ]; then # Locations (in order) to use when searching for an include file. @@ -92,6 +86,12 @@ elif [ -r "$ES_INCLUDE" ]; then . "$ES_INCLUDE" fi +if [ -x "$JAVA_HOME/bin/java" ]; then + JAVA=$JAVA_HOME/bin/java +else + JAVA=`which java` +fi + if [ -z "$ES_CLASSPATH" ]; then echo "You must set the ES_CLASSPATH var" >&2 exit 1