Skip to content

Instantly share code, notes, and snippets.

@johnnymillergh
Last active December 14, 2020 06:08
Show Gist options
  • Save johnnymillergh/d0e02bc4643929c1ef2fa48a0f998bb9 to your computer and use it in GitHub Desktop.
Save johnnymillergh/d0e02bc4643929c1ef2fa48a0f998bb9 to your computer and use it in GitHub Desktop.
EDAS startup command for Windows
@echo on
setlocal
@REM UTF-8
chcp 65001
cls
set SERVER_IP=""
if not "%JRE_HOME%" == "" goto gotJreHome
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
echo At least one of these environment variable is needed to run this program
goto end
:gotJavaHome
rem No JRE given, use JAVA_HOME as JRE_HOME
set "JRE_HOME=%JAVA_HOME%"
:gotJreHome
rem Check if we have a usable JRE
if not exist "%JRE_HOME%\bin\java.exe" goto noJreHome
if not exist "%JRE_HOME%\bin\javaw.exe" goto noJreHome
goto okJava
:noJreHome
rem Needed at least a JRE
echo The JRE_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto exit
:okJava
rem Don't override _RUNJAVA if the user has set it previously
if not "%_RUNJAVA%" == "" goto gotRunJava
rem Set standard command for invoking Java.
rem Also note the quoting as JRE_HOME may contain spaces.
set _RUNJAVA="%JRE_HOME%\bin\java.exe"
:gotRunJava
TITLE EDAS
set _EXECJAVA=call %_RUNJAVA%
%_EXECJAVA% -Daddress.server.ip=%SERVER_IP% -jar edas-config-center.jar
goto end
:end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment