From: Duarte Meneses Date: Fri, 21 Aug 2015 12:28:59 +0000 (+0200) Subject: SONARUNNER-117 If JAVA_HOME is set, use it in the sonar-runner executable X-Git-Tag: 2.5-rc1~45 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=149e5920791741c9af8ec9e277576988cb1ee949;p=sonar-scanner-cli.git SONARUNNER-117 If JAVA_HOME is set, use it in the sonar-runner executable --- diff --git a/sonar-runner-cli/src/main/assembly/bin/sonar-runner b/sonar-runner-cli/src/main/assembly/bin/sonar-runner index b0506e5..5529717 100755 --- a/sonar-runner-cli/src/main/assembly/bin/sonar-runner +++ b/sonar-runner-cli/src/main/assembly/bin/sonar-runner @@ -85,7 +85,13 @@ if [ ! -f "$SONAR_RUNNER_HOME/lib/sonar-runner-dist-${project.version}.jar" ] ; exit 1 fi -JAVA_CMD="`which java`" +if [ -n "$JAVA_HOME" ] +then + JAVA_CMD="$JAVA_HOME/bin/java" +else + JAVA_CMD="`which java`" +fi + JAR_FILE="${SONAR_RUNNER_HOME}"/lib/sonar-runner-dist-${project.version}.jar PROJECT_HOME=`pwd`