diff --git a/dist/bin/common b/dist/bin/common index 652b262cff73..b5239ce28af0 100755 --- a/dist/bin/common +++ b/dist/bin/common @@ -62,7 +62,7 @@ if [ ! -x "$JAVACMD" ] ; then fi # parses 1.7, 1.8, 9, etc out of java version "1.8.0_91" -JAVA_VERSION=$("$JAVACMD" -version 2>&1 | grep ' version "' | sed 's/.*version "\([0-9]*\)\(\.[0-9]*\)\{0,1\}\(.*\)*"/\1\2/; 1q') +JAVA_VERSION=$("$JAVACMD" -version 2>&1 | grep ' version "' | tr '\r' '\n' | sed 's/.*version "\([0-9]*\)\(\.[0-9]*\)\{0,1\}\(.*\)*"/\1\2/; 1q') if [ "$JAVA_VERSION" != "1.8" ] ; then echo "Error: Java 8 is required, actual $JAVA_VERSION"