Cannot launch SonarQube because of java

Hello,

I have just downloaded, dezipped, and run SonarQube 10.2.1.78527 Community Edition, and I got and installed the last JRE (1.8.0_391-b13) some hours ago

When I try to launch StartSonar.bat, I get the following error message :

Starting SonarQube…
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.

Hi,

Sonarqube 10.x needs to run with Java 17
get it here https://adoptium.net/temurin/releases/?version=17
see Prerequisites and overview

Gilbert

Thank you. I just read the top of the page, wich mentionned JRE. And I’ve got the last release…
Then, the documentation talks about hardware, so I thought the software requirements were over ! :slight_smile:

But I don’t understand why the requirements mentiosn JRE 17. It seems the last release is 8 :slight_smile: https://www.java.com/en/download/
So I installed JDK 21.

I have also installed PostgreSQL.

But when I launch StartSonar.bat, I get an other error :

2023.10.20 16:50:04 INFO  app[o.s.a.es.EsSettings] Elasticsearch listening on [HTTP: 127.0.0.1:9001, TCP: 127.0.0.1:58713]
2023.10.20 16:50:04 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[ELASTICSEARCH] from [C:\Users\sva\OneDrive - EDAP TMS\Bureau\sonarqube-10.2.1.78527\elasticsearch]: C:\Program Files\Java\jdk-21\bin\java -Xms4m -Xmx64m -XX:+UseSerialGC -Dcli.name=server -Dcli.script=./bin/elasticsearch -Dcli.libs=lib/tools/server-cli -Des.path.home=C:\Users\sva\OneDrive - EDAP TMS\Bureau\sonarqube-10.2.1.78527\elasticsearch -Des.path.conf=C:\Users\sva\OneDrive - EDAP TMS\Bureau\sonarqube-10.2.1.78527\temp\conf\es -Des.distribution.type=tar -cp C:\Users\sva\OneDrive - EDAP TMS\Bureau\sonarqube-10.2.1.78527\elasticsearch\lib\*;C:\Users\sva\OneDrive - EDAP TMS\Bureau\sonarqube-10.2.1.78527\elasticsearch\lib\cli-launcher\* org.elasticsearch.launcher.CliToolLauncher
2023.10.20 16:50:04 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
oct. 20, 2023 4:50:07 PM sun.util.locale.provider.LocaleProviderAdapter <clinit>
WARNING: COMPAT locale provider will be removed in a future release
2023.10.20 16:50:12 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2023.10.20 16:50:12 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[WEB_SERVER] from [C:\Users\sva\OneDrive - EDAP TMS\Bureau\sonarqube-10.2.1.78527]: C:\Program Files\Java\jdk-21\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=C:\Users\sva\OneDrive - EDAP TMS\Bureau\sonarqube-10.2.1.78527\temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -Dcom.redhat.fips=false -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-10.2.1.78527.jar;C:\Users\sva\OneDrive - EDAP TMS\Bureau\sonarqube-10.2.1.78527\lib\jdbc\h2\h2-2.1.214.jar org.sonar.server.app.WebServer C:\Users\sva\OneDrive - EDAP TMS\Bureau\sonarqube-10.2.1.78527\temp\sq-process2082492275868402949properties
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:429)
        at org.sonar.process.PluginSecurityManager.restrictPlugins(PluginSecurityManager.java:42)
        at org.sonar.server.app.WebSecurityManager.apply(WebSecurityManager.java:47)
        at org.sonar.server.app.WebServer.main(WebServer.java:101)
2023.10.20 16:50:12 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [Web Server]: 1
2023.10.20 16:50:12 INFO  app[][o.s.a.SchedulerImpl] Process[Web Server] is stopped
2023.10.20 16:50:12 INFO  app[][o.s.a.SchedulerImpl] Process[ElasticSearch] is stopped
2023.10.20 16:50:12 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped

Don’t know why https://www.java.com/ recommends Java 8, when Java 21 is the new LTS version, and Java 17 the former !?

Most Enterprise versions do not support Java 21 LTS yet, as it is still relatively new (September 19 2023)
Sonarqube also is not Java 21 ready yet.

Sonarqube 10.2.1 needs to run on Java 17, not Java 8 nor Java 21.
As most users switched from Oracle JDK to some OpenJDK distribution, i posted the link
to the Eclipse Temurin distribution by Adoptium as example.

OK, I installed OpenJDK JRE 17, and I can now launch StartSonar.bat.
Thanks.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.