作为服务运行时将 JVM 参数传递给 Tomcat? [英] Passing JVM arguments to Tomcat when running as a service?

查看:26
本文介绍了作为服务运行时将 JVM 参数传递给 Tomcat?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将几个 JVM 参数传递给运行 Tomcat 的 JVM,以便我的应用程序可以获取它们.

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.

我想按照本文中概述的过程来选取环境变量.

我该怎么做?

更新抱歉,这是在 Windows 下运行的(客户端服务器上的我的 Dev 机器 2003 上的 7)

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

推荐答案

您需要编辑 Windows 服务.有三种方法可以做到这一点:

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

  1. 使用 //MS//ServiceName 启动 Tomcat5w 以在系统托盘中获得一个图标,让您可以快速访问到服务的配置.

  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.

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

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

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

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

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

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//...)

这篇关于作为服务运行时将 JVM 参数传递给 Tomcat?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆