From: Mozes Gaal Date: Fri, 22 Feb 2019 13:24:21 +0000 (+0100) Subject: Check if Java is installed on Linux X-Git-Tag: 3.4.0.1729~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7d46ea49284083dbae03f2a0f2ad4b4247509f17;p=sonar-scanner-cli.git Check if Java is installed on Linux --- diff --git a/src/main/assembly/bin/sonar-scanner b/src/main/assembly/bin/sonar-scanner index dc9d263..fefac84 100755 --- a/src/main/assembly/bin/sonar-scanner +++ b/src/main/assembly/bin/sonar-scanner @@ -49,6 +49,11 @@ else java_cmd="$(which java)" fi +if [ -z "$java_cmd" -o ! -x "$java_cmd" ] ; then + echo "Could not find 'java' executable in JAVA_HOME or PATH." + exit 1 +fi + project_home=$(pwd) #echo "Info: Using sonar-scanner at $sonar_scanner_home"