I have java version 21 and java 17 in my system. And for sonarqube
, the version I am having is 9.8.0, but while running the sonarqube
application, I cant able to start up the application.
The error shown in log file is,
2024.01.14 10:31:36 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\temp
2024.01.14 10:31:36 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:50127]
2024.01.14 10:31:37 INFO app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [C:\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\elasticsearch]: C:\Program Files\Java\jdk-21\bin\java -XX:+UseG1GC -Djava.io.tmpdir=C:\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\temp -XX:ErrorFile=../logs/es_hs_err_pid%p.log -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djna.tmpdir=C:\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\temp -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dio.netty.allocator.numDirectArenas=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j2.formatMsgNoLookups=true -Djava.locale.providers=COMPAT -Dcom.redhat.fips=false -Xmx512m -Xms512m -XX:MaxDirectMemorySize=256m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\elasticsearch -Des.path.conf=C:\sonarqube-9.8.0.63668\sonarqube-9.8.0.63668\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
2024.01.14 10:31:37 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
2024.01.14 10:31:40 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 1
2024.01.14 10:31:40 INFO app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2024.01.14 10:31:40 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
SonarQube 9.8 supports (or rather requires) Java 17. In case you have two versions of Java installed on your machine make sure you set SONAR_JAVA_PATH
by calling:
setx SONAR_JAVA_PATH "C:\Program Files\java_home\bin\java.exe"
Make sure you adjust the path to point to Java 17 in the above code snippet.