cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [05/12] git commit: Fix jvm version detection when JAVA_TOOL_OPTIONS in environment
Date Mon, 21 Jul 2014 12:51:51 GMT
Fix jvm version detection when JAVA_TOOL_OPTIONS in environment

Patch by Gregory Ramsperger, reviewed by brandonwilliams for
CASSANDRA-7572


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

Branch: refs/heads/cassandra-2.0
Commit: 87548095859c210e7be8cc8bbb4a5aa1f857a6ad
Parents: 337e4a8
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Mon Jul 21 07:49:13 2014 -0500
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Mon Jul 21 07:49:13 2014 -0500

----------------------------------------------------------------------
 conf/cassandra-env.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/87548095/conf/cassandra-env.sh
----------------------------------------------------------------------
diff --git a/conf/cassandra-env.sh b/conf/cassandra-env.sh
index 7604918..d4e6590 100644
--- a/conf/cassandra-env.sh
+++ b/conf/cassandra-env.sh
@@ -90,7 +90,7 @@ calculate_heap_sizes()
 
 java_ver_output=`"${JAVA:-java}" -version 2>&1`
 
-jvmver=`echo "$java_ver_output" | awk -F'"' 'NR==1 {print $2}'`
+jvmver=`echo "$java_ver_output" | grep 'java version' | awk -F'"' 'NR==1 {print $2}'`
 JVM_VERSION=${jvmver%_*}
 JVM_PATCH_VERSION=${jvmver#*_}
 
@@ -100,7 +100,7 @@ if [ "$JVM_VERSION" \< "1.7" ] ; then
 fi
 
 
-jvm=`echo "$java_ver_output" | awk 'NR==2 {print $1}'`
+jvm=`echo "$java_ver_output" | grep -A 1 'java version' | awk 'NR==2 {print $1}'`
 case "$jvm" in
     OpenJDK)
         JVM_VENDOR=OpenJDK


Mime
View raw message