且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

作为服务运行时,将JVM参数传递给Tomcat?

更新时间:2023-10-03 08:18:52

您需要编辑Windows服务。有三种方法可以这样做:


  1. 开始 Tomcat5w code> // MS // ServiceName 在系统托盘中获取一个图标,可以快速访问服务的配置。


  2. 在控制面板中打开服务管理器。 Tomcat有一个条目。


在编辑器中,有一个选项卡可以添加其他JVM参数。



第三种方式(我更喜欢)是编写一个为你编辑配置的脚本。这样,您可以将配置保存在某个位置进行备份。请参阅文档如何执行(提示:使用 tomcat5 // US //...


I need to pass a couple of JVM arguments to the JVM which Tomcat is running in so that my application can pick them up.

I want to follow the process outlined in this article to pick up environment variables.

How would I go about doing this?

UPDATE Sorry This is running under windows (7 on my Dev machine 2003 on client server)

You need to edit the Windows service. There are three ways to do this:

  1. Start Tomcat5w with //MS//ServiceName to get an icon in the system tray which gives you a quick access to the configuration of the service.

  2. Open the service manager in the "Control Panel". There is an entry for Tomcat.

In the editor, there is a tab where you can add additional JVM parameters.

The third way (which I prefer) is to write a script which edits the config for you. This way, you can save the config somewhere for backup. See the docs how to do that (Hint: use tomcat5 //US//...)