未找到雄猫 7 setenv.sh

2022-09-01 18:37:46

我下载并提取了apache-tomcat-7.0。根据 RUNNING.txt (%CATALINA_BASE%/RUNNING.txt)中的说明,它应该在“setenv.sh”文件中设置JRE_HOME。

此文件位于何处?文档说,它将在CATALINA_HOME/bin目录中。但是,此文件不存在。


答案 1

文档确实提到了缺少文件:setenv.(sh|bat)

(3.4) Using the "setenv" script (optional, recommended)

Apart from CATALINA_HOME and CATALINA_BASE, all environment variables can
be specified in the "setenv" script. The script is placed either into
CATALINA_BASE/bin or into CATALINA_HOME/bin directory and is named
setenv.bat (on Windows) or setenv.sh (on *nix). The file has to be
readable.

    By default the setenv script file is absent. If the script file is present
    both in CATALINA_BASE and in CATALINA_HOME, the one in CATALINA_BASE is
    preferred

    For example, to configure the JRE_HOME and CATALINA_PID variables you can
    create the following script file:

On Windows, %CATALINA_BASE%\bin\setenv.bat:

  set "JRE_HOME=%ProgramFiles%\Java\jre6"
  exit /b 0


On *nix, $CATALINA_BASE/bin/setenv.sh:

  JRE_HOME=/usr/java/latest
  CATALINA_PID="$CATALINA_BASE/tomcat.pid"

http://tomcat.apache.org/tomcat-7.0-doc/RUNNING.txt


答案 2

只需自己创建一个;它不是发行版的一部分。这并不难。对于您的情况,只需添加

JRE_HOME=/path/to/your/java/installation

添加到该文件,并使其可执行 ()。chmod 755 setenv.sh

如有必要,您还可以添加其他选项(例如)。-Xmx


推荐