Error "Unable to execute Java command. The system cannot find the file specified."

I am using sonarqube-9.0.1.46107 and sonar-scanner-engine-shaded-9.0.1.46107-all to do code analysis written in C#.
I have downloaded Community edition from “Download | SonarQube” and tried running the StartSonar batch file after unzipped it but getting error like “Unable to execute Java command. The system cannot find the file specified.”

Hi @yamini1 and welcome to the community :wave:

did you already check the requirements? SonarQube needs java installed in order to run. If you have already checked this; can you post a little more of the logs?

Thank you! I didnt have Java installed in my machine which is why I am getting this error.Please have a look at the below logs for your reference.

→ Wrapper Started as Console
Launching a JVM…
Unable to execute Java command. The system cannot find the file specified. (0x2)
“java” -Dsonar.wrapped=true -Djava.awt.headless=true -Xms8m -Xmx32m -Djava.library.path="./lib" -classpath “…/…/lib/sonar-application-9.0.1.46107.jar;…/…/lib/jsw/wrapper-3.2.3.jar;…/…/lib/sonar-shutdowner-9.0.1.46107.jar” -Dwrapper.key=“gNMEDhQZDAWP1aY8” -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=23792 -Dwrapper.version=“3.2.3” -Dwrapper.native_library=“wrapper” -Dwrapper.cpu.timeout=“10” -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.sonar.application.App
Critical error: wait for JVM process failed

Ah okay and just to confirm, with Java installed everything is working now?

I have installed Java but now getting issue with version .Let me try downloading different version and check.

→ Wrapper Started as Console
Launching a JVM…
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.

WrapperSimpleApp: Unable to locate the class org.sonar.application.App: java.lang.UnsupportedClassVersionError: org/sonar/application/App has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

WrapperSimpleApp Usage:
java org.tanukisoftware.wrapper.WrapperSimpleApp {app_class} [app_arguments]

Where:
app_class: The fully qualified class name of the application to run.
app_arguments: The arguments that would normally be passed to the
application.
← Wrapper Stopped
→ Wrapper Started as Console
Launching a JVM…
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.

WrapperSimpleApp: Unable to locate the class org.sonar.application.App: java.lang.UnsupportedClassVersionError: org/sonar/application/App has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

WrapperSimpleApp Usage:
java org.tanukisoftware.wrapper.WrapperSimpleApp {app_class} [app_arguments]

Where:
app_class: The fully qualified class name of the application to run.
app_arguments: The arguments that would normally be passed to the
application.
← Wrapper Stopped

You will need Java 11

Now I am facing below issue .I am using community edition and lines of code is around 1000 but not sure why this error .
“14:50:52.571 Your SonarQube instance seems to have an invalid license. Please check it. Server url : http://localhost:9000
14:50:52.571 Pre-processing failed. Exit code: 1”

any help on this?