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

后端 未结 5 1162
名媛妹妹
名媛妹妹 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 10:02

    I know this is an old thread but needed to correct some assumptions.

    Just an FYI, Catalina.bat is not utilized when running tomcat as a service. here is the method to change the JAVA_OPTS for tomcat running as a windows service.

    1. Open Services and click on the Tomcat service. Make a note of the service name (most likely Tomcat6).
    2. cd to the Tomcat bin directory
    3. Run the command

      tomcat6w //ES//Tomcat6 (substitute your service name if different)

    4. Click on the Java tab

    5. Add the options (each on a new line) to the Java Options box and set the initial and max memory to 1536 and 2048

      -XX:MaxPermSize=256m -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true

    6. Click apply

    7. Click on the general tab and restart the service

提交回复
热议问题