Cannot start SonarQube with multiple Java versions running


I had a need to use Java 8 with some other software. So I have installed Java 8 and set it as my JAVA_HOME yesterday. We then had a server outage last night, so I had to restart my Sonar service but it won’t run anymore. I still have Java 11 and I edited my wrapper like so\Program Files\Java\jdk-11.0.4\bin

But I still receive

WARNING - Unable to load the Wrapper's native library 'wrapper.dll'.
          The file is located on the path at the following location but
          could not be loaded:
          Please verify that the file is readable by the current user
          and that the file has not been corrupted in any way.
          One common cause of this problem is running a 32-bit version
          of the Wrapper with a 64-bit version of Java, or vica versa.
          This is a 32-bit JVM.
          Reported cause:
            C:\sonarqube\bin\windows-x86-64\lib\wrapper.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
          System signals will not be handled correctly.

WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: SonarQube requires Java 11+ to run
java.lang.IllegalStateException: SonarQube requires Java 11+ to run
	at org.sonar.application.App.checkJavaVersion(
	at org.sonar.application.App.start(
	at org.sonar.application.App.main(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at Source)
<-- Wrapper Stopped
--> Wrapper Started as Console

I am running on a 64-bit machine. What did I do wrong here?

You have specified just the bin folder, you must include java too.



I have both lines in my config, I just didn’t show the full file :confused:

# Path to JVM executable. By default it must be available in PATH.
# Can be an absolute path, for example:\Program Files\Java\jdk-11.0.4\bin


# Wrapper Java

I fixed it, I needed the full path to Java 11, otherwise just using Java would call Java 8.\Program Files\Java\jdk-11.0.4\bin\Program Files\Java\jdk-11.0.4\bin\java