# Source: https://docs.sonarsource.com/sonarqube-cloud/advanced-setup/ci-based-analysis/sonarscanner-cli.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>

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.

### 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-cloud/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 [general-requirements](https://docs.sonarsource.com/sonarqube-cloud/advanced-setup/scanner-environment/general-requirements "mention") for more information.

### Installation <a href="#installation" id="installation"></a>

* Expand the downloaded file into the directory of your choice. We’ll refer to it as `$install_directory` in the next step.
* Add the `$install_directory/bin` directory to your path.
* Verify your installation by opening a new shell and executing the command `sonar-scanner -h`(`sonar-scanner.bat -h` on Windows). You should get an output like this:

```bash
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`.

### Use <a href="#use" id="use"></a>

* Create a configuration file in the root directory of the project: `sonar-project.properties`

```properties
# Organization and project keys are displayed in the right sidebar of the project homepage
sonar.organization=my_organization
sonar.projectKey=my_project
sonar.host.url=https://sonarcloud.io

# --- 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
```

* Set the environment variable `SONAR_TOKEN` with the Scoped Organization Token (SOT) (recommended from the Team plan) or Personal Access Token (PAT). Note that the token can also be set through the command line argument `-Dsonar.token`.\
  To generate the token, see [scoped-organization-tokens](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/managing-organization/scoped-organization-tokens "mention") or [managing-tokens](https://docs.sonarsource.com/sonarqube-cloud/managing-your-account/managing-tokens "mention").
* Run the command `sonar-scanner`, or `sonar-scanner.bat` on Windows, from the project base directory to run the analysis.

### 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/tree/master) or [downloaded](https://github.com/SonarSource/sonar-scanning-examples/archive/master.zip).

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

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

* The properties can be specified directly through the command line. Example:

```bash
sonar-scanner -Dsonar.organization=my_organization -Dsonar.projectKey=my_project -Dsonar.sources=src
```

* 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).
* The root folder of the project to analyze can be set through the `sonar.projectBaseDir` property. This folder must contain a `sonar-project.properties` file if the `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. For example, when an analysis begins from `jenkins/jobs/myjob/workspace` but the files to be analyzed are in `ftpdrop/cobol/project1`.

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

For more, see the listing of [analysis-parameters](https://docs.sonarsource.com/sonarqube-cloud/advanced-setup/analysis-parameters "mention").

### 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`:

```properties
export SONAR_SCANNER_JAVA_OPTS="-Xmx512m"
```

In Windows environments, avoid using double-quotes, since they get misinterpreted, with the result that the two parameters are combined into a single one.

```properties
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 core packages that embed its own Java runtime.

**Property sonar.cs.analyzer.projectOutPaths is missing**

No protobuf files will be loaded for this project. SonarScanner is not able to analyze .NET projects. Please use the [sonarscanner-for-dotnet](https://docs.sonarsource.com/sonarqube-cloud/advanced-setup/ci-based-analysis/sonarscanner-for-dotnet "mention").