安装和升级 > 安装和配置指南 > 高级配置 > 以 Windows 服务方式运行 Windchill
  
以 Windows 服务方式运行 Windchill
执行以下命令可将 Windchill 配置为以 Windows 服务方式运行。执行命令时会自动启动该服务。
通过 Windchill shell,输入:
ant -buildfile <Windchill>\opt\ntservice\WindchillService.xml install
-DserviceName=<ServiceName>
其中 <ServiceName> 是引用该服务的唯一名称 (例如 WTService)。
现在可以从 Windows 服务实用程序管理 (例如,启动和停止) Windchill。该名称列在您在上述命令中提供的名称 (即 <服务名称>) 下面的实用程序中。
运行 Windows 服务时需要考虑的要点
以下项是您以 Windows 服务方式运行应用程序时应考虑的几个要点:
支持运行的服务的环境与从控制台窗口启动的服务的环境不同。
在默认系统帐户下运行的服务不能访问共享网络资源。必须修改权限才能访问共享网络资源。
服务器启动程序需要具有正式安装的 JRE 才能够运行。正式安装意味着 JRE 是用 JRE 安装程序安装的;它会更新 Windows 注册表。如果 JDK 或 JRE 文件夹是从其他源复制而来,则 JavaSoft (或 IBM) 注册表项将不存在,且服务启动程序将无法定位 JVM。
故障排除提示
如果在“Windows 事件查看器”中显示 "JNI error finding main class" 或 "Unable to change the working directory" 消息,则请尝试以下操作:
验证您的 CLASSPATH 设置,以确保其正确无误。如果目录中含有空格,请将目录路径用引号括起来。
以 Windows 服务方式移除 Windchill
要以服务方式移除 Windchill,请通过 Windchill shell 执行以下命令:
ant -buildfile <Windchill>\opt\ntservice\WindchillService.xml uninstall
-DserviceName=<ServiceName>
其中 <ServiceName> 是您创建 Windchill Windows 服务时为其提供的名称。