I am posting an answer because I don't have enough reputations to comment.
I have faced the same problem. Just go with docker. It works perfectly.
https://hub.docker.com/_/sonarqube/
Use docker desktop and pull this image. Once done open a terminal and run the below commands, it creates volumes for persistence.
docker volume create sonarqube_data
docker volume create sonarqube_logs
docker volume create sonarqube_extensions
Now run the container
docker run -d --name sonarqube -p 9000:9000 -v sonarqube_data:/opt/sonarqube/data -v sonarqube_logs:/opt/sonarqube/logs -v sonarqube_extensions:/opt/sonarqube/extensions sonarqube:latest
Open a browser and access it. Use admin as both password and username.
Once you are in, create a project and follow the instructions. You could easily setup this in minutes.