\r
\r
rem DO NOT EDIT THE FOLLOWING SECTIONS\r
+set REALPATH=%~dp0\r
call :check_if_sonar_is_running FAIL || goto:eof\r
\r
+echo Starting SonarQube...\r
%JAVA_EXE% -Xms8m -Xmx32m^\r
-Djava.awt.headless=true^\r
--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED^\r
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED^\r
--add-opens=java.management/sun.management=ALL-UNNAMED^\r
--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED^\r
- -cp "..\..\lib\sonar-application-@sqversion@.jar" "org.sonar.application.App"\r
+ -cp "%REALPATH%..\..\lib\sonar-application-@sqversion@.jar" "org.sonar.application.App"\r
\r
goto:eof\r
\r
:check_if_sonar_is_running\r
+set "SQ_SERVICE="\r
+for /f %%i in ('%REALPATH%/SonarService.exe status') do set "SQ_SERVICE=%%i"\r
+if [%SQ_SERVICE%]==[Started] (\r
+ echo ERROR: SonarQube is already running as a service.\r
+ exit /b 1\r
+)\r
+\r
set "SQ_PROCESS="\r
where jps >nul 2>nul\r
if %errorlevel% equ 0 (\r