mirror of https://github.com/sbt/sbt.git
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:
parent
697e1239cb
commit
f14b165523
|
|
@ -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'"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue