From 7d46ea49284083dbae03f2a0f2ad4b4247509f17 Mon Sep 17 00:00:00 2001 From: Mozes Gaal Date: Fri, 22 Feb 2019 14:24:21 +0100 Subject: [PATCH] Check if Java is installed on Linux --- src/main/assembly/bin/sonar-scanner | 5 +++++ 1 file changed, 5 insertions(+) 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" -- 2.39.5