Why does sonar-scanner force the usage of the embedded JRE?

scanner

(David Racodon) #1

Hi,

Why does sonar-scanner force the usage of the embedded JRE?
See below extract from the latest version downloaded from https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner:

use_embedded_jre=true
if [ "$use_embedded_jre" = true ]; then
  export JAVA_HOME=$sonar_scanner_home/jre
fi

Even stranger, when downloaded from Maven central (https://search.maven.org/remotecontent?filepath=org/sonarsource/scanner/cli/sonar-scanner-cli/3.2.0.1227/sonar-scanner-cli-3.2.0.1227-linux.zip), the code is different…

use_embedded_jre=false
if [ "$use_embedded_jre" = true ]; then
  export JAVA_HOME=$sonar_scanner_home/jre
fi

Thank you

Regards,

David


(Nicolas Bontoux) #2

Hi David,

The are multiple flavours distributed on this page. Notably the Windows/Linux/Mac ones that do have an embedded JRE, and that’s on purpose to facilitate adoption/usage.

The Any flavour is the one that doesn’t have an embedded JRE, as clearly stated:

*This package expects that a JVM is already installed on the system - with same Java requirements as the SonarQube server.


(David Racodon) #3

Thanks for the quick reply Nicolas!
My apologies for not noticing the comment…