]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
Check if Java is installed on Linux
authorMozes Gaal <mgaal@chemaxon.com>
Fri, 22 Feb 2019 13:24:21 +0000 (14:24 +0100)
committerJanos Gyerik <janos.gyerik@sonarsource.com>
Fri, 22 Feb 2019 16:46:26 +0000 (17:46 +0100)
src/main/assembly/bin/sonar-scanner

index dc9d263034859ded06c98e0f3f5fa38ec3a6ed01..fefac842ea8ee9eeeab58f129f5ab25f0ae34777 100755 (executable)
@@ -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"