Last active
December 14, 2020 06:08
-
-
Save johnnymillergh/d0e02bc4643929c1ef2fa48a0f998bb9 to your computer and use it in GitHub Desktop.
EDAS startup command for Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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