Fix java version detection

Previously awk was used to grab the full Java version such as 1.8.0_91.
While this is more accurate, 1.8.0_91 is not a number that can be compared by bash, and thus JDK8 detection logics were failing.
Fixes #135
This commit is contained in:
Eugene Yokota 2017-01-11 00:20:38 -05:00
parent 697e1239cb
commit f14b165523
1 changed files with 1 additions and 1 deletions

View File

@ -147,7 +147,7 @@ process_args () {
process_my_args "${myargs[@]}"
}
java_version=$("$java_cmd" -Xmx512M -version 2>&1 | awk -F '"' '/version/ {print $2}')
java_version=$("$java_cmd" -Xmx512M -version 2>&1 | sed 's/.*version "\([0-9]*\)\.\([0-9]*\)\..*"/\1.\2/; 1q')
vlog "[process_args] java_version = '$java_version'"
}