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 a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Do you want to learn Quantum Computing?
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND