Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

SonarQube Could not create the Java Virtual Machine Unrecognized option: --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED

Writer Sebastian Wright

Trying to use SonarQube, Community edition, for my first experience with SonarQube. I have just now downloaded it, and am following instructions to start a local instance. I am running Java v10.0.2.

When I run the D:\SonarQube\bin\windows-x86-64\StartSonar.bat file, I get an error launching a JVM. The exact output of StartSonar.bat is:

wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
jvm 1 | Unrecognized option: --add-exports=
jvm 1 | Error: Could not create the Java Virtual Machine.
jvm 1 | Error: A fatal exception has occurred. Program will exit.
wrapper | JVM exited while loading the application.
wrapper | JVM Restarts disabled. Shutting down.
wrapper | <-- Wrapper Stopped

4 Answers

You will need the Java JDK (or the JVM if you prefer), version 11 or higher. You can download and install 11.0.11 from here: .

This error due to lower version of java installed in your machine. First install java version 11.

If you have multiple java version installed in your machine then choose java version 11 using command sudo alternatives --config java

If issues still persists then follow the below steps I have my sonarQube installed in directory /opt/sonarqube

  1. open /opt/sonarqube/conf/wrapper.conf in your favourite text editor.
  2. Change value of wrapper.java.command= with the path where jre 11 is installed. You can find all your java installation in /usr/lib/jvm folder.
  3. I changed it to wrapper.java.command=/usr/lib/jvm/jre-11-openjdk-11.0.16.0.8-1.amzn2.0.1.x86_64/bin/javaenter image description here

Step1: I also faced this issue with Java 8 version, for SonarQube needs version 11 or higher.

Step2: after install the JAVA 11 then open the cmd open the directory where you save SonarQube.

\sonarqube-9.7.0.61563\bin\windows-x86-64>StartSonar.bat

Type the StartSonar.bat

Awesome Sonar started

enter image description here

Step3: The above 9000 port for SonarQube by default.

enter image description here

Default Login and password

Login: admin

Password: admin

This error due to lower version of java installed in your machine. To run sonar latest version need atlest JAVA 11. So, First install java version 11.

If you have multiple java version installed in your machine then choose java version at least 11 or higher using command sudo alternatives --config java

If still issue is occurring then follow the below step:

  1. Go to INSTALLED PATH/sonarqube-10.1.0.73491\bin\windows-x86-64\lib and open find_java.bat file.
  2. Add your java path at set JAVA_EXE="C:/Program Files/Java/jdk-17/bin/java.exe".

Code snipped of my find_java.bat

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.