diff --git a/solr/bin/solr b/solr/bin/solr index e61808d080c4..509ca6c650ea 100755 --- a/solr/bin/solr +++ b/solr/bin/solr @@ -175,7 +175,7 @@ if [[ $? -ne 0 ]] ; then echo >&2 "${PATH}" exit 1 else - JAVA_VER_NUM=$(echo "$JAVA_VER" | grep -v '_OPTIONS' | head -1 | awk -F '"' '/version/ {print $2}' | sed -e's/^1\.//' | sed -e's/[._-].*$//') + JAVA_VER_NUM=$(echo "$JAVA_VER" | grep -v '_OPTIONS' | awk -F '"' '/ version "/ {print $2; exit}' | sed -e's/^1\.//' | sed -e's/[._-].*$//') if (( JAVA_VER_NUM < JAVA_VER_REQ )) ; then echo >&2 "Your current version of Java is too old to run this version of Solr." echo >&2 "We found major version $JAVA_VER_NUM, using command '${JAVA} -version', with response:"