In Workstation
Step 1 – Install Java
$ sudo apt update
$ sudo apt install openjdk-17-jdk
$ sudo apt install openjdk-17-jre
$ java –version
Step 2 – Download a Scanner
$ wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-7.1.0.4889-linux-x64.zip
$ sudo apt install unzip
$ unzip sonar-scanner-cli-7.1.0.4889-linux-x64.zip
$ unzip sonar-scanner-cli-7.1.0.4889-linux-x64.zip
$ mv sonar-scanner-7.1.0.4889-linux-x64 sonar-scanner
Step 3 – Download the source code
$ git clone https://github.com/devopsschool-demo-labs-projects/java-sonarqube-helloworld-src.git
Step 4 – Configure a scanner
$ cd sonar-scanner
$ cd conf
$ vi sonar-scanner.properties
sonar.host.url=http://3.109.214.5:9000/
sonar.login=squ_a428a75a14d702d278f56e6eda2801f74e7916ec

Step 5 – Run the scanner on the source coce
$ cd java-sonarqube-helloworld-src
$ vi sonar-project.properties
$ /home/ubuntu/rajesh/sonar-scanner/bin/sonar-scanner
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals