Getting the error msg Removed stale pid file: ./ when trying to start the sonarqube

Getting the below error message when trying to start the sonar server.

[sonar@Sonarqube sonarqube]$ cd bin/linux-x86-64/
[sonar@Sonarqube linux-x86-64]$ ./ start
Starting SonarQube…
Removed stale pid file: ./
Failed to start SonarQube.
[sonar@Sonarqube linux-x86-64]$ java -version
java version “1.8.0_131”
Java™ SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot™ 64-Bit Server VM (build 25.131-b11, mixed mode)```

i have checked in the logs folder got the below error.

Unrecognized option: --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Could you please let me know how can i resolve the issue.

Hey there.

What version of SonarQube are you trying to install? Both supported versions, v9.9 LTS and v10.3, have a minimum Java requirement of Java 17. Java 8 won’t cut it.

If you have multiple versions of Java installed on your machine, you can point to the one SonarQube should use by setting the SONAR_JAVA_PATH environment variable.