Installing and Configuring SonarQube on Windows

Installing Sonarqube

Madhan Kumar
3 min readJul 23, 2024
SONARQUBE

Step 1: Download and Install Oracle Java 17

Before installing SonarQube, ensure you have Java installed by following these steps:

  • Download Oracle Java 17: Visit Oracle’s website and download Oracle Java 17.
  • Install Java: Run the downloaded installer and follow the prompts in the installation wizard.
  • Set Environment Variable: Configure the JAVA_HOME environment variable to point to C:\Program Files\Java\jdk-17\bin.

Step 2: Download and Install SonarQube

Now, let’s install SonarQube by following these steps:

  • Download SonarQube: Download the SonarQube zip file from SonarSource.
  • Extract Files: Unzip the contents to C:\sonarqube-10.4.1.88267.
  • Set Environment Variable: Use the Command Prompt to set the SONAR_JAVA_PATH environment variable:

set “SONAR_JAVA_PATH=C:\Program Files\Java\jdk-17\bin\java.exe”

Step 3: Start SonarQube

Start SonarQube using the following command in CMD:

Step 4: Access SonarQube Web Interface

  • Open a Browser: Launch your web browser and go to http://localhost:9000.
  • Log In: Use the default credentials admin/admin to log in.
  • Change Password: Follow the prompts to update the default password.

Step 5: Install SonarScanner

SonarScanner allows you to analyze your projects for code quality. Here’s how to install it:

  • Download SonarScanner: Get the SonarScanner CLI from SonarSource.
  • Extract Files: Unzip the contents to a directory, e.g., C:\sonar-scanner-5.0.1.3006-windows.

Step 6: Analyze Your Project

  • Open Command Prompt: Launch the Command Prompt.
  • Run SonarScanner: Execute the following SonarScanner command:

C:\sonar-scanner-5.0.1.3006-windows\bin\sonar-scanner.bat -D”sonar.projectKey=myproject” -D”sonar.sources=.” -D”sonar.host.url=http://localhost:9000" -D”sonar.login=<your_token_here>”

Step 7: Create and Analyze a Project in SonarQube

  • Log in to SonarQube dashboard.
  • Navigate to Projects tab > Create Project.
  • Set up the project using global settings.
  • Analyze your project locally using SonarScanner.
  • Provide a token for authentication and execute the SonarScanner command.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Madhan Kumar
Madhan Kumar

Written by Madhan Kumar

Software Engineer By Profession | Blogger | Full Stack Developer | AI Explorer | Writer of tech, love, relationships, trends & self-care articles

No responses yet

Write a response