I have already read and tried a lot posts on SO, but no one has solved this issue.
I set to enviroment variables for JDK and JRE release. I have add the same values within both sections "user's variables for USER" and "system variables". The variables that I have added is: JAVA_HOME->C:\PROGRA~1\Java\JDK9U4~1 and JRE_HOME->C:\PROGRA~1\Java\JRE9U4~1.
My installations directory for JDK and JRE are respectly "C:\Program Files\Java\JDK 9u4" and "C:\Program Files\Java\JRE 9u4".
When I run catalina_start.bat, I getting this error:
[XAMPP]: Searching JDK HOME with reg query ...
Errore: The registry key or the specified value could not be found.
. [XAMPP]: Cannot find current JDK installation!
. [XAMPP]: Cannot set JAVA_HOME. Aborting ...
done.
The text of my catalina_start.bat file (and I think this is default) is:
@echo off
::::::::::::::::::::::::::::::::::::
:: Set JAVA_HOME and ::
::::::::::::::::::::::::::::::::::::
IF EXIST tomcat\logs\catalina.pid (
del /F/Q tomcat\logs\catalina.pid
)
echo.
echo [XAMPP]: Searching JDK HOME with reg query ...
set KeyName=HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit
reg query "%KeyName%" /s
if %ERRORLEVEL% == 1 (
echo . [XAMPP]: Cannot find current JDK installation!
echo . [XAMPP]: Cannot set JAVA_HOME. Aborting ...
goto :END
)
set "CURRENT_DIR=%cd%"
set "CATALINA_HOME=%CURRENT_DIR%"
:: only for windows 32 bit if you have problems with the tcnative-1.dll
:: set CATALINA_OPTS=-Djava.library.path="%CATALINA_HOME%\bin"
set Cmd=reg query "%KeyName%" /s
for /f "tokens=2*" %%i in ('%Cmd% ^| find "JavaHome"') do set JAVA_HOME=%%j
echo.
echo [XAMPP]: Seems fine!
echo [XAMPP]: Set JAVA_HOME : %JAVA_HOME%
echo [XAMPP]: Set CATALINA_HOME : %CATALINA_HOME%
echo.
if %ERRORLEVEL% == 0 (
echo run > logs\catalina.pid
)
"%CATALINA_HOME%\bin\catalina.bat" run
:END
echo done.
pause
I have already tried many solutions, but nothing have helped me. I wondered if someone could to help me with this, I would be very grateful. I hope that I have explained myself clearly (sorry for my english). Thanks for advices.