How to change java_opts for tomcat when we run it as a windows service manually?

后端 未结 5 1170
名媛妹妹
名媛妹妹 2021-02-05 09:35

I\'m manually running tomcat 6 as a windows service on the console. I need to change java_opts before starting it. How do I do that? Also, Is there a way I can see the logs dyna

5条回答
  •  广开言路
    2021-02-05 09:55

    To change the settings, create a file named setenv.bat for windows or setenv.sh for Linux with entry as below:

    Windows:

    set JAVA_OPTS="-Xms256m -Xmx512m"
    

    Linux:

    export JAVA_OPTS="-Xms256m -Xmx512m"
    

    Simply put this(setenv.bat/setenv.sh) file in %CATALINA_HOME%\bin\ folder. Your command file (catalina.bat/catalina.sh) already has a statement as below:

    Windows:

    if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
    

    Linux:

    if [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then
     . "$CATALINA_BASE/bin/setenv.sh"
    

    elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then . "$CATALINA_HOME/bin/setenv.sh" fi This will take care the rest.

提交回复
热议问题