knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject git commit: KNOX-346: The knox-env.sh script should prefer JAVA_HOME over java on path Contributed by svelpula at hortonworks dot com
Date Mon, 07 Apr 2014 22:02:30 GMT
Repository: knox
Updated Branches:
  refs/heads/v0.4.0 c6b15b51d -> ba9097b91


KNOX-346: The knox-env.sh script should prefer JAVA_HOME over java on path
Contributed by svelpula at hortonworks dot com


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/ba9097b9
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/ba9097b9
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/ba9097b9

Branch: refs/heads/v0.4.0
Commit: ba9097b9155425f4161bf98f10600d078e1f7858
Parents: c6b15b5
Author: Kevin Minder <kevin.minder@hortonworks.com>
Authored: Mon Apr 7 18:02:25 2014 -0400
Committer: Kevin Minder <kevin.minder@hortonworks.com>
Committed: Mon Apr 7 18:02:25 2014 -0400

----------------------------------------------------------------------
 gateway-release/home/bin/knox-env.sh | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/ba9097b9/gateway-release/home/bin/knox-env.sh
----------------------------------------------------------------------
diff --git a/gateway-release/home/bin/knox-env.sh b/gateway-release/home/bin/knox-env.sh
index 4fd2a70..fd860ac 100644
--- a/gateway-release/home/bin/knox-env.sh
+++ b/gateway-release/home/bin/knox-env.sh
@@ -26,15 +26,7 @@ function findJava() {
       JAVA=""
     fi
   fi
-
-  # Try to find java on PATH.
-  if [ "$JAVA" == "" ]; then
-    JAVA=`which java 2>/dev/null`
-    if [ ! -x "$JAVA" ]; then
-      JAVA=""
-    fi
-  fi
-
+  
   # Try to use JAVA_HOME to find java.
   if [ "$JAVA" == "" ]; then
     if [ "$JAVA_HOME" != "" ]; then
@@ -45,6 +37,14 @@ function findJava() {
     fi
   fi
 
+  # Try to find java on PATH.
+  if [ "$JAVA" == "" ]; then
+    JAVA=`which java 2>/dev/null`
+    if [ ! -x "$JAVA" ]; then
+      JAVA=""
+    fi
+  fi
+
   # Use the search patterns to find java.
   if [ "$JAVA" == "" ]; then
     for pattern in "${JAVA_VERSION_PATTERNS[@]}"; do
@@ -58,4 +58,4 @@ function findJava() {
   fi
 }
 
-findJava
\ No newline at end of file
+findJava


Mime
View raw message