Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
<div class="table-wrap"><table style="line-height: 1.4285715;" class="confluenceTable"><tbody><tr><td class="highlight-grey confluenceTd" data-highlight-colour="grey">By <a target="_top" href="">SonarSource</a> &#8211; GNU LGPL 3 &#8211;
<a target="_top" href="">Issue Tracker</a> &#8211;
<a target="_top" href="">Sources</a>
    <div style="padding-top:10px;padding-bottom:5px">
    <span style="font-size:larger;"><strong>SonarQube Scanner 2.5<5.1</strong></span>
     &#8211; Compatible with SonarQube 4.5.4+ (LTS)
    <a target="_top" href="">Download</a>
</div> </td></tr></tbody></table></div>



  • SonarQube is already installed
  • At least the minimal version of Java supported by your SonarQube server is in use
  • The language plugins for each of the languages you wish to analyze are installed
  • You have read Analyzing Code Source


  1. Expand the downloaded file into the directory of your choice. We'll refer to it as <install_directory> in the next steps.
  2. Update the global settings (server URL) by editing <install_directory>/conf/

    Code Block
    #----- Default SonarQube server
  3. Create a new SONAR_RUNNER_HOME environment variable set to <install_directory>.
  4. Add the <install_directory>/bin directory to your path.
  5. You can check the basic installation by opening a new shell and executing the command sonar-runner -h (on Windows platform the command is sonar-runner.bat -h) . You should get a message like this:

    Code Block
    usage: sonar-runner [options]
     -D,--define <arg>     Define property
     -e,--errors           Produce execution error messages
     -h,--help             Display help information
     -v,--version          Display version information
     -X,--debug            Produce execution debug output


Code Block

Include Page
SONAR:Include - Analysis - Security
SONAR:Include - Analysis - Security

Project Samples

To help you get started, simple project samples are available for most languages on github. They can be browsed or downloaded. You'll find them filed under projects/languages.


The root folder of the project to analyze can be set through the sonar.projectBaseDir property since SonarQube Scanner 2.4 (was previously project.home). This folder must contain a file if the mandatory properties (like sonar.projectKey) are not specified on the command line.

Additional analysis parameters can be defined in this project configuration file or through command-line parameters. 


For more, see the listing of analysis parameters.



If you get a Java heap space error or java.lang.OutOfMemoryError, you can increase the memory via the SONAR_RUNNER_OPTS environment variable:

Code Block
export SONAR_RUNNER_OPTS="-Xmx512m -XX:MaxPermSize=128m"

On Windows environments, avoid the double-quotes, since they get misinterpreted and combine the two parameters into a single one.

Code Block
set SONAR_RUNNER_OPTS=-Xmx512m -XX:MaxPermSize=128m