/geoserver/bin/startup.sh
修改这个启动文件的配置
# Guard against misconfigured JAVA_HOME
if [ -n "${JAVA_HOME:-}" ] && [ ! -x "${JAVA_HOME}/bin/java" ]; then
echo "The JAVA_HOME environment variable is set but JAVA_HOME/bin/java"
echo "is missing or not executable:"
echo " JAVA_HOME=${JAVA_HOME}"
echo "Please either set JAVA_HOME so that the Java runtime is JAVA_HOME/bin/java"
echo "or unset JAVA_HOME to use the Java runtime on the PATH."
exit 1
fi
# Find java from JAVA_HOME or PATH
if [ -n "${JAVA_HOME:-}" ]; then
_RUNJAVA="${JAVA_HOME}/bin/java"
elif [ -n "$(command -v java)" ]; then
_RUNJAVA=java
else
echo "A Java runtime (java) was not found in JAVA_HOME/bin or on the PATH."
echo "Please either set the JAVA_HOME environment variable so that the Java runtime"
echo "is JAVA_HOME/bin/java or add the Java runtime to the PATH."
exit 1
fi
直接指定java路径
# 指定 Java 的绝对路径
_RUNJAVA="/usr/lib/jvm/java-11-openjdk-amd64/bin/java"
/geoserver/bin/shutdown.sh
也设置一下
windows下的bat文件直接设置如下
set JAVA_HOME=D:\APP\Develop\JAVA\JDK11
标签:bin,java,echo,Java,geoserver,HOME,JAVA
From: https://www.cnblogs.com/echohye/p/17859419.html