Java 11 not detected although it is installed

I am having some problems installing SonarQube, can I get some support with this?
I installed a fresh Windows Server 2019 Standard machine

After some struggles on the Oracle site, I downloaded and installed JDK 11.0.3

After doing some troubleshooting, I added a System environment variable as follows:

JAVA_HOME = C:\Program Files\Java\jdk-11.0.3\

But, when I try to run \sonarqube-7.9.1\bin\windows-x86-64\StartSonar.bat I get the following error:

wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM…
jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
jvm 1 |
jvm 1 |
jvm 1 | WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: SonarQube requires Java 11+ to run
jvm 1 | java.lang.IllegalStateException: SonarQube requires Java 11+ to run
jvm 1 | at org.sonar.application.App.checkJavaVersion(App.java:93)
jvm 1 | at org.sonar.application.App.start(App.java:56)
jvm 1 | at org.sonar.application.App.main(App.java:98)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
jvm 1 | at java.lang.Thread.run(Unknown Source)
wrapper | <-- Wrapper Stopped

Any idea what is causing this?

Hi,

what’s the output of java -version ?
In any case you might put the path to JAVA_HOME\bin\java into %SONARQUBE_HOME%\conf\wrapper.conf

# Path to JVM executable. By default it must be available in PATH.
# Can be an absolute path, for example:
#wrapper.java.command=/path/to/my/jdk/bin/java
wrapper.java.command=Java
[...]

see documentation https://wrapper.tanukisoftware.com/doc/english/integrate-simple-win.html#wrapperconf

Gilbert

1 Like

java -version did not work
I added the java bin path to the path env variable and this solved the problem

Hi,

ok, after you added %JAVA_HOME%\bin to PATH (assumed this had already been done, as for me it’s always part of java installation) the default entry in %SONARQUBE_HOME%\conf\wrapper.conf

wrapper.java.command=java

works now.

Gilbert