]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
SONARUNNER-117 If JAVA_HOME is set, use it in the sonar-runner executable
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Fri, 21 Aug 2015 12:28:59 +0000 (14:28 +0200)
committerDuarte Meneses <duarte.meneses@sonarsource.com>
Fri, 21 Aug 2015 12:28:59 +0000 (14:28 +0200)
sonar-runner-cli/src/main/assembly/bin/sonar-runner

index b0506e509a8eaae0f1111504333ffa65b0f88f4d..5529717187b7f018fb96e4152f1f99a5adcbedc5 100755 (executable)
@@ -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`