Error showing while running Sonar.bat file

--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2022.04.18 13:06:48 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\Users\hp\Downloads\sonarqube-9.4.0.54424 (1)\sonarqube-9.4.0.54424\temp
2022.04.18 13:06:48 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:50520]
2022.04.18 13:06:49 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [C:\Users\hp\Downloads\sonarqube-9.4.0.54424 (1)\sonarqube-9.4.0.54424\elasticsearch]: C:\Program Files\jdk-18\bin\java -XX:+UseG1GC -Djava.io.tmpdir=C:\Users\hp\Downloads\sonarqube-9.4.0.54424 (1)\sonarqube-9.4.0.54424\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:\Users\hp\Downloads\sonarqube-9.4.0.54424 (1)\sonarqube-9.4.0.54424\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:\Users\hp\Downloads\sonarqube-9.4.0.54424 (1)\sonarqube-9.4.0.54424\elasticsearch -Des.path.conf=C:\Users\hp\Downloads\sonarqube-9.4.0.54424 (1)\sonarqube-9.4.0.54424\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
2022.04.18 13:06:51 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
Exception in thread "main" java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
	at java.base/java.lang.System.setSecurityManager(System.java:416)
	at org.elasticsearch.bootstrap.Security.setSecurityManager(Security.java:99)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:70)
2022.04.18 13:07:15 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [ElasticSearch]: 1
2022.04.18 13:07:15 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2022.04.18 13:07:15 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
<-- Wrapper Stopped

Hi,

The SonarQube server requires JDK 11 as stated on Prerequisites and Overview | SonarQube Docs

You could install JDK 11 and set the property wrapper.java.command on the file “\conf\wrapper.conf”, for example:

wrapper.java.command=C:\Program Files\Java\jdk-11.0.14\bin\java

1 Like