Repository: ranger
Updated Branches:
  refs/heads/master caf373daf -> 8d9bd5fba


RANGER-1846:This JAVA_VERSION_REQUIRED configuration item is invalid in 
security admin installer, we should enable it to control the necessary java 
version.

Signed-off-by: peng.jianhua <[email protected]>


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

Branch: refs/heads/master
Commit: 8d9bd5fbaeb5a555134de50d3bab3ec560267c6f
Parents: caf373d
Author: peng.jianhua <[email protected]>
Authored: Fri Oct 20 09:57:16 2017 +0800
Committer: peng.jianhua <[email protected]>
Committed: Mon Oct 23 09:44:36 2017 +0800

----------------------------------------------------------------------
 security-admin/scripts/setup.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/8d9bd5fb/security-admin/scripts/setup.sh
----------------------------------------------------------------------
diff --git a/security-admin/scripts/setup.sh b/security-admin/scripts/setup.sh
index e2a69b7..468e8a0 100755
--- a/security-admin/scripts/setup.sh
+++ b/security-admin/scripts/setup.sh
@@ -291,23 +291,23 @@ check_java_version() {
                log "[E] JAVA_HOME environment property not defined, aborting 
installation."
                exit 1
        fi
-
         export JAVA_BIN=${JAVA_HOME}/bin/java
 
        if is_command ${JAVA_BIN} ; then
                log "[I] '${JAVA_BIN}' command found"
        else
-               log "[E] '${JAVA_BIN}' command not found"
-               exit 1;
+        log "[E] '${JAVA_BIN}' command not found"
+        exit 1;
        fi
 
        version=$("$JAVA_BIN" -version 2>&1 | awk -F '"' '/version/ {print $2}')
        major=`echo ${version} | cut -d. -f1`
        minor=`echo ${version} | cut -d. -f2`
-       if [[ "${major}" == 1 && "${minor}" < 7 ]] ; then
-               log "[E] Java 1.7 is required, current java version is $version"
+       current_java_version="$major.$minor"
+    if [[ "$current_java_version" != "$JAVA_VERSION_REQUIRED" ]];then
+        log "[E] Java $JAVA_VERSION_REQUIRED is required, current java version 
is $version"
                exit 1;
-       fi
+    fi
 }
 
 sanity_check_files() {

Reply via email to