hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r894505 - in /hadoop/hbase/trunk: CHANGES.txt bin/hbase-config.sh
Date Tue, 29 Dec 2009 23:08:21 GMT
Author: stack
Date: Tue Dec 29 23:08:20 2009
New Revision: 894505

URL: http://svn.apache.org/viewvc?rev=894505&view=rev
Log:
HBASE-2074 Improvements to the hadoop-config script

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/bin/hbase-config.sh

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=894505&r1=894504&r2=894505&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Tue Dec 29 23:08:20 2009
@@ -257,6 +257,7 @@
                times
    HBASE-2062  Metrics documentation outdated (Lars George via JD)
    HBASE-2045  Update trunk and branch zk to just-release 3.2.2.
+   HBASE-2074  Improvements to the hadoop-config script
 
   NEW FEATURES
    HBASE-1901  "General" partitioner for "hbase-48" bulk (behind the api, write

Modified: hadoop/hbase/trunk/bin/hbase-config.sh
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/bin/hbase-config.sh?rev=894505&r1=894504&r2=894505&view=diff
==============================================================================
--- hadoop/hbase/trunk/bin/hbase-config.sh (original)
+++ hadoop/hbase/trunk/bin/hbase-config.sh Tue Dec 29 23:08:20 2009
@@ -44,7 +44,9 @@
 this="$bin/$script"
 
 # the root of the hbase installation
-export HBASE_HOME=`dirname "$this"`/..
+if [ -z "$HBASE_HOME" ]; then
+  export HBASE_HOME=`dirname "$this"`/..
+fi
 
 #check to see if the conf dir or hbase home are given as an optional arguments
 while [ $# -gt 1 ]
@@ -71,3 +73,33 @@
 HBASE_CONF_DIR="${HBASE_CONF_DIR:-$HBASE_HOME/conf}"
 # List of hbase regions servers.
 HBASE_REGIONSERVERS="${HBASE_REGIONSERVERS:-$HBASE_CONF_DIR/regionservers}"
+
+if [ -z "$JAVA_HOME" ]; then
+  for candidate in \
+    /usr/lib/jvm/java-6-sun \
+    /usr/lib/j2sdk1.6-sun \
+    /usr/java/jdk1.6* \
+    /usr/java/jre1.6* \
+    /Library/Java/Home ; do
+    if [ -e $candidate/bin/java ]; then
+      export JAVA_HOME=$candidate
+      break
+    fi
+  done
+  # if we didn't set it
+  if [ -z "$JAVA_HOME" ]; then
+    cat 1>&2 <<EOF
++======================================================================+
+|      Error: JAVA_HOME is not set and Java could not be found         |
++----------------------------------------------------------------------+
+| Please download the latest Sun JDK from the Sun Java web site        |
+|       > http://java.sun.com/javase/downloads/ <                      |
+|                                                                      |
+| HBase requires Java 1.6 or later.                                    |
+| NOTE: This script will find Sun Java whether you install using the   |
+|       binary or the RPM based installer.                             |
++======================================================================+
+EOF
+    exit 1
+  fi
+fi



Mime
View raw message