"Fossies" - the Fresh Open Source Software Archive

Member "elasticsearch-6.8.23/bin/elasticsearch-env.bat" (6 Jan 2022, 1969 Bytes) of package /linux/www/elasticsearch-6.8.23.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) MS DOS Batch source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "elasticsearch-env.bat": 6.8.22_vs_8.0.0-rc1.

    1 set SCRIPT=%0
    2 
    3 rem determine Elasticsearch home; to do this, we strip from the path until we
    4 rem find bin, and then strip bin (there is an assumption here that there is no
    5 rem nested directory under bin also named bin)
    6 for %%I in (%SCRIPT%) do set ES_HOME=%%~dpI
    7 
    8 :es_home_loop
    9 for %%I in ("%ES_HOME:~1,-1%") do set DIRNAME=%%~nxI
   10 if not "%DIRNAME%" == "bin" (
   11   for %%I in ("%ES_HOME%..") do set ES_HOME=%%~dpfI
   12   goto es_home_loop
   13 )
   14 for %%I in ("%ES_HOME%..") do set ES_HOME=%%~dpfI
   15 
   16 rem now set the classpath
   17 set ES_CLASSPATH=!ES_HOME!\lib\*
   18 
   19 rem now set the path to java
   20 if defined JAVA_HOME (
   21   set JAVA="%JAVA_HOME%\bin\java.exe"
   22 ) else (
   23   echo warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME
   24   for %%I in (java.exe) do set JAVA="%%~$PATH:I"
   25 )
   26 
   27 if not exist %JAVA% (
   28   echo could not find java; set JAVA_HOME 1>&2
   29   exit /b 1
   30 )
   31 
   32 rem do not let JAVA_TOOL_OPTIONS slip in (as the JVM does by default)
   33 if defined JAVA_TOOL_OPTIONS (
   34   echo warning: ignoring JAVA_TOOL_OPTIONS=%JAVA_TOOL_OPTIONS%
   35   set JAVA_TOOL_OPTIONS=
   36 )
   37 
   38 rem JAVA_OPTS is not a built-in JVM mechanism but some people think it is so we
   39 rem warn them that we are not observing the value of %JAVA_OPTS%
   40 if defined JAVA_OPTS (
   41   (echo|set /p=warning: ignoring JAVA_OPTS=%JAVA_OPTS%; )
   42   echo pass JVM parameters via ES_JAVA_OPTS
   43 )
   44 
   45 rem check the Java version
   46 %JAVA% -cp "%ES_CLASSPATH%" "org.elasticsearch.tools.java_version_checker.JavaVersionChecker" || exit /b 1
   47 
   48 set HOSTNAME=%COMPUTERNAME%
   49 
   50 if not defined ES_PATH_CONF (
   51   set ES_PATH_CONF=!ES_HOME!\config
   52 )
   53 
   54 rem now make ES_PATH_CONF absolute
   55 for %%I in ("%ES_PATH_CONF%..") do set ES_PATH_CONF=%%~dpfI
   56 
   57 set ES_DISTRIBUTION_FLAVOR=default
   58 set ES_DISTRIBUTION_TYPE=tar
   59 
   60 if not defined ES_TMPDIR (
   61   for /f "tokens=* usebackq" %%a in (`CALL %JAVA% -cp "!ES_CLASSPATH!" "org.elasticsearch.tools.launchers.TempDirectory"`) do set  ES_TMPDIR=%%a
   62 )