diff --git a/bin/hbase b/bin/hbase index 4be7b519a81..1fcf0bc1558 100755 --- a/bin/hbase +++ b/bin/hbase @@ -31,11 +31,14 @@ # # HBASE_CLASSPATH Extra Java CLASSPATH entries. # +# HBASE_CLASSPATH_PREFIX Extra Java CLASSPATH entries that should be +# prefixed to the system classpath. +# # HBASE_HEAPSIZE The maximum amount of heap to use, in MB. # Default is 1000. # # HBASE_LIBRARY_PATH HBase additions to JAVA_LIBRARY_PATH for adding -# native libaries. +# native libraries. # # HBASE_OPTS Extra Java runtime options. # @@ -169,11 +172,6 @@ for f in $HBASE_HOME/lib/*.jar; do CLASSPATH=${CLASSPATH}:$f; done -# Add user-specified CLASSPATH first -if [ "$HBASE_CLASSPATH" != "" ]; then - CLASSPATH=${HBASE_CLASSPATH}:${CLASSPATH} -fi - # default log directory & file if [ "$HBASE_LOG_DIR" = "" ]; then HBASE_LOG_DIR="$HBASE_HOME/logs" @@ -223,6 +221,16 @@ if [ -d "${HBASE_HOME}/build/native" -o -d "${HBASE_HOME}/lib/native" ]; then fi fi +# Add user-specified CLASSPATH last +if [ "$HBASE_CLASSPATH" != "" ]; then + CLASSPATH=${CLASSPATH}:${HBASE_CLASSPATH} +fi + +# Add user-specified CLASSPATH prefix first +if [ "$HBASE_CLASSPATH_PREFIX" != "" ]; then + CLASSPATH=${HBASE_CLASSPATH_PREFIX}:${CLASSPATH} +fi + # cygwin path translation if $cygwin; then JAVA_LIBRARY_PATH=`cygpath -p "$JAVA_LIBRARY_PATH"`