Linux系统
if [ ! -z "$JAVA_HOME" ]; then
JAVA="$JAVA_HOME/bin/java"
JAVA_TYPE="JAVA_HOME"
else
if [ "$(uname -s)" = "Darwin" ]; then
# macOS has a different structure
JAVA="$ES_HOME/jdk.app/Contents/Home/bin/java"
else
JAVA="$ES_HOME/jdk/bin/java"
fi
JAVA_TYPE="bundled jdk"
fi
修改为
if [ "$(uname -s)" = "Darwin" ]; then
# macOS has a different structure
JAVA="$ES_HOME/jdk.app/Contents/Home/bin/java"
else
JAVA="$ES_HOME/jdk/bin/java"
fi
JAVA_TYPE="bundled jdk"
Windows环境
if defined ES_JAVA_HOME (
set JAVA="%ES_JAVA_HOME%\bin\java.exe"
set JAVA_TYPE=ES_JAVA_HOME
) else if defined JAVA_HOME (
rem fallback to JAVA_HOME
echo "warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME" >&2
set JAVA="%JAVA_HOME%\bin\java.exe"
set "ES_JAVA_HOME=%JAVA_HOME%"
set JAVA_TYPE=JAVA_HOME
) else (
rem use the bundled JDK (default)
set JAVA="%ES_HOME%\jdk\bin\java.exe"
set "ES_JAVA_HOME=%ES_HOME%\jdk"
set JAVA_TYPE=bundled JDK
)
修改为
set JAVA="%ES_HOME%\jdk\bin\java.exe"
set JAVA_HOME="%ES_HOME%\jdk"
标签:set,JAVA,jdk,JDK,java,ElasticSearch,HOME,自带,ES
From: https://www.cnblogs.com/zuitaiping/p/17086464.html