Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SonerQube doesnt start

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)
like image 535
cryptoparty Avatar asked Jul 04 '19 09:07

cryptoparty


People also ask

How do I restart SonarQube?

Restarting SonarQube can be done manually from the command line by running sonar.sh restart . In SonarQube Community Edition, you can also restart from the UI, in the Update Center. When you have Pending Changes, the restart button will be displayed in the yellow banner (see Pending Operations).


2 Answers

  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
like image 59
Adnan Zameer Avatar answered Oct 22 '22 11:10

Adnan Zameer


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.

like image 36
guttosm Avatar answered Oct 22 '22 13:10

guttosm