When I execute StartSonar.bat the CMD open and automatically closes and doesn’t shows nothing. I’m using java 18, 17 and 11.
It’s a bug, you can edit the files
lib/find_java.bat and replace the latest
exit /b 0. (Also note that SonarQube server requires Java 11)
What solved my problem was to add the JAVA_HOME and the Java directory in Path, in system environment variables.
Check this video: Installing Java and Setting Up the Environment Variables | GeeksforGeeks - YouTube
It worked ! What knowledge helped you come to this solution ?
Setting JAVA_HOME alone will not resolve this. Adding the location the “bin” directory of the JDK install will to your PATH will. In this, my JDK is installed at C:\Program Files\Java\jdk-188.8.131.52
set PATH=%PATH%;C:\Program Files\Java\jdk-184.108.40.206\bin
The Oracle JDK 11 installer places another copy of java.exe in \Program Files\Common Files\Oracle\Java\javapath and adds to the PATH. Version 9.6/9.6.1 does not like this location and will quietly abort with no log output.
Can confirm that this issue was due to issues with my Java installation. What worked for me was installing the OpenJDK version specified in the prereqs page and adding it to the path a la Brian’s instructions. If problems persist after that, at least you should be able to find helpful logs in /logs folder.