Skip to content

Commit

Permalink
CHE-4865: Correctly detect installed java version (#4870)
Browse files Browse the repository at this point in the history
* CHE-4865: Correctly detect installed java version

* Fix up
  • Loading branch information
Anatoliy Bazko authored and Eugene Ivantsov committed Apr 24, 2017
1 parent 7457950 commit ad3dbd8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ INSTALL_JDK=false
command -v ${JAVA_HOME}/bin/java >/dev/null 2>&1 || {
INSTALL_JDK=true;
} && {
java_version=$(${JAVA_HOME}/bin/java -version 2>&1 | sed 's/.* version "\\(.*\\)\\.\\(.*\\)\\..*"/\\1\\2/; 1q')
if [ ! -z "${java_version##*[!0-9]*}" ] && [ "${java_version}" -lt "18" ]; then
java_version=$(${JAVA_HOME}/bin/java -version 2>&1 | grep version | awk '{print $NF}' | sed 's/"//g' | cut -d '.' -f2)
if [ ! "${java_version}" -eq "8" ]; then
INSTALL_JDK=true;
fi
}
Expand Down

0 comments on commit ad3dbd8

Please sign in to comment.