SonarQube: Error: Could not create the Java Virtual Machine

We Are Going To Discuss About SonarQube: Error: Could not create the Java Virtual Machine. So lets Start this Java Article.

SonarQube: Error: Could not create the Java Virtual Machine

  1. SonarQube: Error: Could not create the Java Virtual Machine

    Your problem most likely occurs due to the fact that you are attempting to run SonarQube with an unsupported Java version.
    From the error log, I presume that you are attempting to run it using either Java 14 or Java 15 based on these lines:

  2. Could not create the Java Virtual Machine

    Your problem most likely occurs due to the fact that you are attempting to run SonarQube with an unsupported Java version.
    From the error log, I presume that you are attempting to run it using either Java 14 or Java 15 based on these lines:

Solution 1

Your problem most likely occurs due to the fact that you are attempting to run SonarQube with an unsupported Java version.

From the error log, I presume that you are attempting to run it using either Java 14 or Java 15 based on these lines:

Picked up _JAVA_OPTIONS: -Xmx1024M
Unrecognized VM option 'UseConcMarkSweepGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

The CMS collector was deprecated in Java 9 and removed altogether in Java 14:

https://openjdk.java.net/jeps/363

This means that the batch script that attempts to start Sonar is passing in some JVM args that are no longer valid.

Based on their documentation that only supported Java version are 8 and 11

https://docs.sonarqube.org/latest/requirements/requirements/

and version above those are not supported:

SonarQube scanners require version 8 or 11 of the JVM and the
SonarQube server requires version 11. Versions beyond Java 11 are not
officially supported.

I suggest you attempt to run it using the correct Java version. Also please check the related documentation beforehand to avoid such issues.

Original Author Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment