# Source: https://docs.sonarsource.com/sonarqube-community-build/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/8.9/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/9.8/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/9.9/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/10.0/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/10.1/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/10.2/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/10.3/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/10.4/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/10.5/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/10.6/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/10.7/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/10.8/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.2/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.3/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.5/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.1/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.4/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.6/analyzing-source-code/scanners/sonarscanner.md

# Source: https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/scanners/sonarscanner.md

# SonarScanner CLI

<details>

<summary>SonarScanner — 8.0.1 | <a href="https://sonarsource.atlassian.net/jira/software/c/projects/SQSCANNER/issues">Issue Tracker</a></summary>

**8.0.1** <sup><sub>**2025-12-05**<sub></sup>\ <sup>Update embedded JREs to Java 21</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-8.0.1.6346-linux-x64.zip) [Linux AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-8.0.1.6346-linux-aarch64.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-8.0.1.6346-windows-x64.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-8.0.1.6346-macosx-x64.zip) [macOS AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-8.0.1.6346-macosx-aarch64.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-8.0.1.6346.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=fixVersion%20%3D%2023522%20ORDER%20BY%20created%20ASC)

***

**7.3** <sup><sub>**2025-10-06**<sub></sup>\ <sup>Support z/OS as an Operating System to execute Scanners</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.3.0.5189-linux-x64.zip) [Linux AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.3.0.5189-linux-aarch64.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.3.0.5189-windows-x64.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.3.0.5189-macosx-x64.zip) [macOS AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.3.0.5189-macosx-aarch64.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.3.0.5189.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixversion%20%3D%207.3)

***

**7.2** <sup><sub>**2025-07-21**<sub></sup>\ <sup>Restore ability to run the scanner with Java 11, update dependencies</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.2.0.5079-linux-x64.zip) [Linux AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.2.0.5079-linux-aarch64.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.2.0.5079-windows-x64.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.2.0.5079-macosx-x64.zip) [macOS AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.2.0.5079-macosx-aarch64.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.2.0.5079.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixversion%20%3D%207.2)

***

**7.1** <sup><sub>**2025-03-21**<sub></sup>\ <sup>Support for SonarQube Cloud regions</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.1.0.4889-linux-x64.zip) [Linux AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.1.0.4889-linux-aarch64.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.1.0.4889-windows-x64.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.1.0.4889-macosx-x64.zip) [macOS AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.1.0.4889-macosx-aarch64.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.1.0.4889.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixversion%20%3D%207.1)

***

**7.0.2** <sup><sub>**2025-02-14**<sub></sup>\ <sup>Bug fix to support SONAR\_TOKEN on old SonarQube versions</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.2.4839-linux-x64.zip) [Linux AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.2.4839-linux-aarch64.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.2.4839-windows-x64.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.2.4839-macosx-x64.zip) [macOS AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.2.4839-macosx-aarch64.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.2.4839.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixversion%20%3D%207.0.2)

***

**7.0.1** <sup><sub>**2025-02-03**<sub></sup>\ <sup>Support empty truststore password</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.1.4817-linux-x64.zip) [Linux AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.1.4817-linux-aarch64.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.1.4817-windows-x64.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.1.4817-macosx-x64.zip) [macOS AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.1.4817-macosx-aarch64.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.1.4817.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixversion%20%3D%207.0.1)

***

**7.0** <sup><sub>**2025-01-20**<sub></sup>\ <sup>Non-latin character support in properties files, ISO-8859-1 support dropped</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.0.4796-linux-x64.zip) [Linux AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.0.4796-linux-aarch64.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.0.4796-windows-x64.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.0.4796-macosx-x64.zip) [macOS AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.0.4796-macosx-aarch64.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.0.0.4796.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixversion%20%3D%207.0)

***

**6.2.1** <sup><sub>**2024-10-01**<sub></sup>\ <sup>FIPS support and improved SSL configuration</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610-linux-x64.zip) [Linux AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610-linux-aarch64.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610-windows-x64.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610-macosx-x64.zip) [macOS AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610-macosx-aarch64.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.1.4610.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixversion%20%3D%206.2.1)

***

**6.2** <sup><sub>**2024-09-17**<sub></sup>\ <sup>Support PKCS12 truststore generated with OpenSSL</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.0.4584-linux-x64.zip) [Linux AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.0.4584-linux-aarch64.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.0.4584-windows-x64.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.0.4584-macosx-x64.zip) [macOS AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.0.4584-macosx-aarch64.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.2.0.4584.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixversion%20%3D%206.2)

***

**6.1** <sup><sub>**2024-06-27**<sub></sup>\ <sup>macOS and Linux AArch64 distributions</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-linux-x64.zip) [Linux AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-linux-aarch64.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-windows-x64.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-macosx-x64.zip) [macOS AArch64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-macosx-aarch64.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixVersion%20%3D%2015671)

***

**6.0** <sup><sub>**2024-06-04**<sub></sup>\ <sup>New bootstrapping mechanism and JRE provisioning with SonarQube 10.6+ and SonarCloud</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.0.0.4432.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixVersion%20%3D%2015344)

***

**5.0.2** <sup><sub>**2025-06-02**<sub></sup>\ <sup>Security fix</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.2.4997-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.2.4997-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.2.4997-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.2.4997.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixVersion%20%3D%2020322)

***

**5.0.1** <sup><sub>**2023-08-04**<sub></sup>\ <sup>Bug fix to the JRE binaries for Linux</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixVersion%20%3D%2014231)

***

**5.0** <sup><sub>**2023-07-31**<sub></sup>\ <sup>Update embedded JRE to Java 17</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.0.2966-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.0.2966-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.0.2966-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.0.2966.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixVersion%20%3D%2013991)

***

**4.8.1** <sup><sub>**2023-08-14**<sub></sup>\ <sup>Security fix</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.1.3023-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.1.3023-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.1.3023-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.1.3023.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixVersion%20%3D%2014243)

***

**4.8** <sup><sub>**2022-02-06**<sub></sup>\ <sup>Update embedded JRE 11 to the latest, bug fixes</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project%20%3D%2010143%20AND%20fixVersion%20%3D%2012892)

***

**4.7** <sup><sub>**2022-02-02**<sub></sup>\ <sup>Ease import of custom certificates with the Docker image, update embedded JRE 11</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.7.0.2747-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.7.0.2747-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.7.0.2747-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.7.0.2747.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project+%3D+10143+AND+fixVersion+%3D+12891)

***

**4.6.2** <sup><sub>**2021-05-07**<sub></sup>\ <sup>Update dependencies, bug fix</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project+%3D+10143+AND+fixVersion+%3D+12890)

***

**4.6.1** <sup><sub>**2021-04-30**<sub></sup>\ <sup>Update dependencies</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.1.2450-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.1.2450-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.1.2450-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.1.2450.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project+%3D+10143+AND+fixVersion+%3D+12889)

***

**4.6** <sup><sub>**2021-01-13**<sub></sup>\ <sup>Support for Bitbucket Pipelines with SonarQube 8.7+</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.0.2311-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.0.2311-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.0.2311-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.0.2311.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project+%3D+10143+AND+fixVersion+%3D+12888)

***

**4.5** <sup><sub>**2020-10-05**<sub></sup>\ <sup>Fix a bug preventing the analysis in some environments</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.5.0.2216-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.5.0.2216-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.5.0.2216-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.5.0.2216.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project+%3D+10143+AND+fixVersion+%3D+12887)

***

**4.4** <sup><sub>**2020-07-03**<sub></sup>\ <sup>New supported Docker image, bug fix</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.4.0.2170-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.4.0.2170-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.4.0.2170-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.4.0.2170.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project+%3D+10143+AND+fixVersion+%3D+12886)

***

**4.3** <sup><sub>**2019-03-09**<sub></sup>\ <sup>Use SonarScanner name and better handle SonarCloud case in logs</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.3.0.2102-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.3.0.2102-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.3.0.2102-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.3.0.2102.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project+%3D+10143+AND+fixVersion+%3D+12885)

***

**4.2** <sup><sub>**2019-10-01**<sub></sup>\ <sup>Support SONAR\_HOST\_URL environment variable to configure the server URL</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.2.0.1873-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.2.0.1873-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.2.0.1873-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.2.0.1873.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project+%3D+10143+AND+fixVersion+%3D+12884)

***

**4.1** <sup><sub>**2019-09-09**<sub></sup>\ <sup>Improve the use of a custom project configuration file</sup>\
Download scanner for: [Linux x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.1.0.1829-linux.zip) [Windows x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.1.0.1829-windows.zip) [macOS x64](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.1.0.1829-macosx.zip) [Docker](https://hub.docker.com/r/sonarsource/sonar-scanner-cli) [Any (Requires a pre-installed JVM)](https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.1.0.1829.zip)\
\
[Release notes](https://sonarsource.atlassian.net/issues/?jql=project+%3D+10143+AND+fixVersion+%3D+12883)

</details>

{% hint style="warning" %}
We do not recommend running an antivirus scanner on the machine where a SonarQube Server analysis runs, it could result in unpredictable behavior.
{% endhint %}

The SonarScanner CLI is the scanner to use when there is no specific scanner for your build system. It supports ARM architecture for macOS and Linux.

{% hint style="info" %}
The SonarScanners run on code that is checked out. See [verifying-code-checkout-step](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/scanners/scanner-environment/verifying-code-checkout-step "mention").
{% endhint %}

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* Java 21 or later, Java 17 has been deprecated. See [#java-runtime-environment-jre](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/scanner-environment/general-requirements#java-runtime-environment-jre "mention") for more details.
* With JRE auto-provisioning:
  * Java 11 or later from SonarScanner CLI version 7.2
  * Java 17 or later before SonarScanner CLI version 7.2

See also [general-requirements](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/scanners/scanner-environment/general-requirements "mention") and [managing-jre-auto-provisioning](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/scanners/scanner-environment/managing-jre-auto-provisioning "mention") for more details.

### Configuring your project <a href="#configuring-your-project" id="configuring-your-project"></a>

Create a configuration file in your project’s root directory called `sonar-project.properties`.

```properties
# must be unique in a given SonarQube Server instance
sonar.projectKey=my:project

# --- optional properties ---

# defaults to project key
#sonar.projectName=My project
# defaults to 'not provided'
#sonar.projectVersion=1.0
 
# Path is relative to the sonar-project.properties file. Defaults to .
#sonar.sources=.
 
# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
```

### Running SonarScanner CLI from the zip file <a href="#running-from-zip-file" id="running-from-zip-file"></a>

To run SonarScanner CLI from the zip file, follow these steps:

{% tabs %}
{% tab title="MACOS, LINUX, Z/OS" %}

1. Expand the downloaded file into the directory of your choice. We’ll refer to it as `<INSTALL_DIRECTORY>` in the next steps.
2. Add the `<INSTALL_DIRECTORY>/bin` directory to your path.
3. Verify your installation by opening a new shell and executing the command `sonar-scanner.bat -h`. You should get an output like this:\
   `usage: sonar-scanner [options]`

   `Options:`\
   `-D,--define <arg> Define property`\
   `-h,--help Display help information`\
   `-v,--version Display version information`\
   `-X,--debug Produce execution debug output`

   If you need more debug information, you can add one of the following to your command line: `-X`, `--verbose`, or `-Dsonar.verbose=true`.
4. Run the following command from the project base directory to launch analysis:&#x20;

   ```shellscript
   sonar-scanner -Dsonar.token=myAuthenticationToken -Dsonar.host.url=http://${SONARQUBE_URL}
   ```

   Alternatively, you can use environment variables to define the token ( `SONAR_TOKEN` ) and the server base URL (`SONAR_HOST_URL`).&#x20;

   For more information, see [parameters-not-settable-in-ui](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/analysis-parameters/parameters-not-settable-in-ui "mention") and [managing-tokens](https://docs.sonarsource.com/sonarqube-server/user-guide/managing-tokens "mention").
   {% endtab %}

{% tab title="WINDOWS" %}

1. Expand the downloaded file into the directory of your choice. We’ll refer to it as `<INSTALL_DIRECTORY>` in the next steps.
2. Add the `<INSTALL_DIRECTORY>\bin` directory to your path.
3. Verify your installation by opening a new shell and executing the command `sonar-scanner.bat -h`. You should get an output like this:\
   `usage: sonar-scanner [options]`

   `Options:`\
   `-D,--define <arg> Define property`\
   `-h,--help Display help information`\
   `-v,--version Display version information`\
   `-X,--debug Produce execution debug output`

   If you need more debug information, you can add one of the following to your command line: `-X`, `--verbose`, or `-Dsonar.verbose=true`.
4. Run the following command from the project base directory to launch analysis:&#x20;

   ```shellscript
   sonar-scanner -Dsonar.token=myAuthenticationToken -Dsonar.host.url=http://${SONARQUBE_URL}
   ```

   Alternatively, you can use environment variables to define the token ( `SONAR_TOKEN` ) and the server base URL (`SONAR_HOST_URL`).&#x20;

   For more information, see [parameters-not-settable-in-ui](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/analysis-parameters/parameters-not-settable-in-ui "mention") and [managing-tokens](https://docs.sonarsource.com/sonarqube-server/user-guide/managing-tokens "mention").
   {% endtab %}
   {% endtabs %}

### Running SonarScanner CLI from the Docker image <a href="#sonarscanner-from-docker-image" id="sonarscanner-from-docker-image"></a>

To scan using the SonarScanner CLI Docker image, use the following command:

```bash
docker run \
    --rm \
    -e SONAR_HOST_URL="http://${SONARQUBE_URL}"  \
    -e SONAR_TOKEN="myAuthenticationToken" \
    -v "${YOUR_REPO}:/usr/src" \
    sonarsource/sonar-scanner-cli
```

Use a `sonar-project.properties` file to configure other analysis parameters: see **Configuring your project** above.

By default, the the scanner will run the analysis from the `/usr/src` folder with `/usr/src` as the base directory. It's possible to configure an [alternate analysis directory](#alternate-analysis-directory) using the `sonar.projectBaseDir`  analysis parameter.

{% hint style="warning" %}
When running the container you have to make sure the user **1000** has read and write access to the directories you are mounting (like your source code or scanner cache directory), otherwise you may encounter permission-related problems.
{% endhint %}

<details>

<summary>Caching scanner files</summary>

To prevent SonarScanner from re-downloading language analyzers each time you run a scan, you can mount a directory where the scanner stores the downloads so that the downloads are reused between scanner runs. On some CI systems, you also need to add this directory to your CI cache configuration.

The following command will store and use cache between runs:

```bash
docker run \
    --rm \
    -v ${YOUR_CACHE_DIR}:/opt/sonar-scanner/.sonar/cache \
    -v ${YOUR_REPO}:/usr/src \
    -e SONAR_HOST_URL="http://${SONARQUBE_URL}" \
    sonarsource/sonar-scanner-cli
```

You can also change the location of where the scanner puts the downloads with the `SONAR_USER_HOME` environment variable.

{% hint style="info" %}
The user must have the appropriate access to the cache target to avoid permission-related problems
{% endhint %}

</details>

### Scanning C, C++, or Objective-C projects <a href="#scanning-c-family-projects" id="scanning-c-family-projects"></a>

Scanning projects that contain C, C++, or Objective-C code requires some additional analysis steps. You can find full details on the [overview](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/languages/c-family/overview "mention") language page.

### Sample projects <a href="#sample-projects" id="sample-projects"></a>

To help you get started, simple project samples are available for most languages on GitHub. They can be [browsed](https://github.com/SonarSource/sonar-scanning-examples) or [downloaded](https://github.com/SonarSource/sonar-scanning-examples/archive/master.zip). You’ll find them filed under `sonarqube-scanner/src`.

### Alternatives to sonar-project.properties <a href="#sonar-project-properties" id="sonar-project-properties"></a>

If a `sonar-project.properties` file cannot be created in the root directory of the project, there are several alternatives:

* The properties can be specified directly through the command line. Example:\
  `sonar-scanner -Dsonar.projectKey=myproject -Dsonar.sources=src1`
* The property `project.settings` can be used to specify the path to the project configuration file (this option is incompatible with the `sonar.projectBaseDir` property). Example:\
  `sonar-scanner -Dproject.settings=../myproject.properties`
* The root folder of the project to analyze can be set through the `sonar.projectBaseDir` property since SonarScanner CLI 2.4. This folder must contain a `sonar-project.properties` file if `sonar.projectKey` is not specified on the command line. Additional analysis parameters can be defined in this project configuration file or through command-line parameters.

### Alternate analysis directory <a href="#alternate-analysis-directory" id="alternate-analysis-directory"></a>

If the files to be analyzed are not in the directory where the analysis starts from, use the `sonar.projectBaseDir` property to move analysis to a different directory. E.g. analysis begins from `jenkins/jobs/myjob/workspace` but the files to be analyzed are in `ftpdrop/cobol/project1`. This is configured in `sonar-project.properties` as follows:

```properties
sonar.projectBaseDir=/home/ftpdrop/cobol/project1
sonar.sources=src
sonar.cobol.copy.directories=/copy
```

{% hint style="info" %}
You can configure more parameters. See [analysis-parameters](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/analysis-parameters "mention") for details.
{% endhint %}

### Advanced configuration <a href="#advanced-configuration" id="advanced-configuration"></a>

#### If your SonarQube Server instance is secured <a href="#if-your-sonarqube-server-instance-is-secured" id="if-your-sonarqube-server-instance-is-secured"></a>

If your SonarQube Server instance is secured behind a proxy and a self-signed certificate, you must add the self-signed certificate to the trusted CA certificates of the SonarScanner. In addition, if mutual TLS is used, you must define the access to the client certificate at the SonarScanner level.

See [manage-tls-certificates](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/scanners/scanner-environment/manage-tls-certificates "mention") and [securing-behind-proxy](https://docs.sonarsource.com/sonarqube-server/server-installation/network-security/securing-behind-proxy "mention") for more information.

### Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

**Java heap space error or java.lang.OutOfMemoryError**

Increase the memory using `SONAR_SCANNER_JAVA_OPTS` environment variable for SonarScanner CLI version 6.0 and higher. For the previous versions use `SONAR_SCANNER_OPTS`:

```bash
export SONAR_SCANNER_JAVA_OPTS="-Xmx512m"
```

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

```bash
set SONAR_SCANNER_JAVA_OPTS=-Xmx512m
```

**"java" cannot be opened because the developer cannot be verified**

The SonarScanner CLI is not yet Apple verified therefore, when using the macOS AArch64 version, you may get an OS security window displaying this message. A solution us to run:

```bash
sudo xattr -dr com.apple.quarantine /path/to/sonar-scanner-version-macosx-aarch64
```

**Unsupported major.minor version**

Install the last version of SonarScanner CLI (from version 6.0, no JRE installation is required). Otherwise, upgrade the version of Java being used for analysis or use one of the native package (that embed its own Java runtime).

**Property missing: ‘sonar.cs.analyzer.projectOutPaths’. No protobuf files will be loaded for this project.**

The SonarScanner CLI cannot analyze .NET projects; please use the SonarScanner for .NET. If you are running the SonarScanner for .NET, ensure that you are not hitting a known limitation. See the [introduction](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/scanners/dotnet/introduction "mention") to SonarScanner for .NET for more information.