10

Sonarqube Startup script does not start ob ubuntu 16.04

Error log shows:

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(App.java:93)
    at org.sonar.application.App.start(App.java:56)
    at org.sonar.application.App.main(App.java:98)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
    at java.lang.Thread.run(Thread.java:748)
<-- Wrapper Stopped
--> Wrapper Started as Console
Launching a JVM...
Startup failed: Timed out waiting for a signal from the JVM.
JVM did not exit on request, terminated
JVM Restarts disabled.  Shutting down.
<-- Wrapper Stopped

If i run java -version:

java version "11.0.3" 2019-04-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.3+12-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.3+12-LTS, mixed mode)
cryptoparty
  • 345
  • 1
  • 5
  • 20
  • can you rule this out ? https://stackoverflow.com/questions/15624667/mac-osx-java-terminal-version-incorrect – newbie Jul 04 '19 at 09:30
  • cat /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64" – cryptoparty Jul 04 '19 at 09:45

6 Answers6

11
  1. Open conf/wrapper.conf file
  2. Change wrapper.java.command=java to path where your JavaDK is installed eg. wrapper.java.command=C:\Program Files\Java\jdk-11.0.4\bin\java
BartusZak
  • 1,041
  • 14
  • 21
Adnan Zameer
  • 732
  • 3
  • 10
  • 23
2

I had the same problem a few moments ago, my JAVA_HOME variable pointed to the correct version of my profile, but when I run java -version, it printed 1.8, so I run this command:

update-java-alternatives -l

This showed me all Java versions that were installed on my machine.
After that, I run this another command:

sudo update-java-alternatives -s java-11-oracle

This changed the Java version on my machine and it works just fine.

zx485
  • 28,498
  • 28
  • 50
  • 59
guttosm
  • 31
  • 5
1

"Warning Support for Java 8 has been deprecated in SonarQube v7.8 and will be removed in SonarQube v7.9 LTS."

checkout you java -version, and the Supported Platforms requirements: https://docs.sonarqube.org/7.7/requirements/requirements/

Then go to the downloads and choose what is the best for you: https://www.sonarqube.org/downloads/ (Show all versions)

Leo Lanese
  • 476
  • 4
  • 5
0

Check for the JRE version, I have come across the issue where the Java SDK version and JRE -version was different. That may be the issue.

0

Most user would like to download JDK 11 here as mentioned in recent comments. That should works.

However, I would recommend to install latest version from following link (because you have just downloaded latest sonarqube) for better compatibility.

SDK download link: https://www.oracle.com/java/technologies/javase-downloads.html

Deepak Rajpal
  • 811
  • 1
  • 8
  • 11
0

FYI, For mac user, Install JVM on your machine (I installed it by Homebrew).

brew cask install java

and restarted the sonar by

./sonar.sh restart

it worked for me

Mohan Ohanra
  • 101
  • 3