You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by el...@apache.org on 2015/01/24 01:10:46 UTC
svn commit: r1654438 - in /lucene/dev/branches/lucene_solr_5_0: ./ solr/
solr/CHANGES.txt solr/bin/ solr/bin/solr
Author: elyograg
Date: Sat Jan 24 00:10:45 2015
New Revision: 1654438
URL: http://svn.apache.org/r1654438
Log:
SOLR-7024: bin/solr: Improve java detection and error messages (merge trunk r1654434)
Modified:
lucene/dev/branches/lucene_solr_5_0/ (props changed)
lucene/dev/branches/lucene_solr_5_0/solr/ (props changed)
lucene/dev/branches/lucene_solr_5_0/solr/CHANGES.txt (contents, props changed)
lucene/dev/branches/lucene_solr_5_0/solr/bin/ (props changed)
lucene/dev/branches/lucene_solr_5_0/solr/bin/solr
Modified: lucene/dev/branches/lucene_solr_5_0/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_0/solr/CHANGES.txt?rev=1654438&r1=1654437&r2=1654438&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_5_0/solr/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_5_0/solr/CHANGES.txt Sat Jan 24 00:10:45 2015
@@ -460,6 +460,10 @@ Bug Fixes
* SOLR-6856: Restore ExtractingRequestHandler's ability to capture all HTML tags when
parsing (X)HTML. (hossman, ehatcher, Steve Rowe)
+* SOLR-7024: Improved error messages when java is not found by the bin/solr
+ shell script, particularly when JAVA_HOME has an invalid location.
+ (Shawn Heisey)
+
Optimizations
----------------------
Modified: lucene/dev/branches/lucene_solr_5_0/solr/bin/solr
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_0/solr/bin/solr?rev=1654438&r1=1654437&r2=1654438&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_5_0/solr/bin/solr (original)
+++ lucene/dev/branches/lucene_solr_5_0/solr/bin/solr Sat Jan 24 00:10:45 2015
@@ -119,12 +119,27 @@ elif [ -n "$JAVA_HOME" ]; then
break
fi
done
+ if [ -z "$JAVA" ]; then
+ echo >&2 "The currently defined JAVA_HOME ($JAVA_HOME) refers"
+ echo >&2 "to a location where Java could not be found. Aborting."
+ echo >&2 "Either fix the JAVA_HOME variable or remove it from the"
+ echo >&2 "environment so that the system PATH will be searched."
+ exit 1
+ fi
else
JAVA=java
fi
# test that Java exists and is executable on this server
-$JAVA -version >/dev/null 2>&1 || { echo >&2 "Java is required to run Solr! Please install Java 7 or 8 before running this script."; exit 1; }
+$JAVA -version >/dev/null 2>&1 || {
+ echo >&2 "Java not found, or an error was encountered when running java."
+ echo >&2 "A working Java 8 is required to run Solr!"
+ echo >&2 "Please install Java 8 or fix JAVA_HOME before running this script."
+ echo >&2 "Command that we tried: '${JAVA} -version'"
+ echo >&2 "Active Path:"
+ echo >&2 "${PATH}"
+ exit 1
+}
# URL scheme for contacting Solr
SOLR_URL_SCHEME=http