SonarQube Could not create the Java Virtual Machine Unrecognized option: --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED
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
- open
/opt/sonarqube/conf/wrapper.confin your favourite text editor. - Change value of
wrapper.java.command=with the path where jre 11 is installed. You can find all your java installation in/usr/lib/jvmfolder. - 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/java
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.batType the StartSonar.bat
Awesome Sonar started
Step3: The above 9000 port for SonarQube by default.
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:
- Go to INSTALLED PATH/sonarqube-10.1.0.73491\bin\windows-x86-64\lib and open find_java.bat file.
- Add your java path at set JAVA_EXE="C:/Program Files/Java/jdk-17/bin/java.exe".