java - 找不到 Tomcat 7 setenv.sh

标签 java tomcat tomcat7 setenv

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

这个文件在哪里?文档说,它将在 CATALINA_HOME/bin 目录中。但是,该文件不存在。

最佳答案

文档确实提到了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

关于java - 找不到 Tomcat 7 setenv.sh,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9480210/

相关文章:

java - 如何从委托(delegate)方法的类创建对象?

java - JFrame/JPanel 不更新重绘或重新验证

Java单元测试,从循环断言中获取更多数据

spring - 没有 SQL 连接

tomcat - 如何在 Net-beans IDE 中添加两个 tomcat 服务器?

java - 启动tomcat时出现ClassNotFoundException错误

启用安全管理器的 Tomcat 7 和 Servlet 3.0 模式上下文加载中的 Spring

Java如何返回枚举值和名称(卡片)

java - 如何用应用程序上下文配置文件替换 web.xml?

Tomcat7 Manager App认证问题