Công nghệ Mẹo vặt WebGIS

GeoServer set JAVA_HOME manually

Table of Content

GeoServer set JAVA_HOME manually

Thông báo lỗi

image

Cách set JAVA_HOME thủ công

catalina_start.bat

@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

REM reg query "%KeyName%" /s
REM if %ERRORLEVEL% == 1 (
  REM echo . [XAMPP]: Cannot find current JDK installation! 
  REM echo . [XAMPP]: Cannot set JAVA_HOME. Aborting ...
  REM goto :END
REM )

set "CURRENT_DIR=%cd%"
set "CATALINA_HOME=%CURRENT_DIR%"
set JAVA_HOME=C:\Program Files\Java\jdk-13.0.1
REM JAVA_HOME=C:\Program Files\Java\jdk1.8.0_25; (path where your JDK is)
REM JRE_Home=C:\Program Files\Java\jre1.8.0_25; 

:: only for windows 32 bit if you have problems with the tcnative-1.dll
:: set CATALINA_OPTS=-Djava.library.path="%CATALINA_HOME%\bin"

REM set Cmd=reg query "%KeyName%" /s
REM 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

Leave a Reply

Your email address will not be published. Required fields are marked *