Tomcat 8 运行 作为 Windows Server 2008 上的服务的问题

Problems with Tomcat 8 running as a service on Windows Server 2008

当 运行在 windows 上使用 Tomcat 7 和 8(64 位)作为服务时,我遇到了这个问题。

这是我面临的错误:(在 /log/commons-daemon.log 上)

[2015-06-11 17:03:37] [info]  [ 2744] Starting service...
[2015-06-11 17:03:37] [error] [ 2744] Failed creating java C:\Program Files (x86)\Java\jre1.8.0_45\bin\client\jvm.dll
[2015-06-11 17:03:37] [error] [ 2744] The system cannot find the path     specified.
[2015-06-11 17:03:37] [error] [ 2744] ServiceStart returned 1
[2015-06-11 17:03:37] [error] [ 2744] The system cannot find the path     specified.
[2015-06-11 17:03:37] [info]  [ 2848] Run service finished.
[2015-06-11 17:03:37] [info]  [ 2848] Commons Daemon procrun finished

这很奇怪,因为我可以在命令行上 运行 服务器。 环境变量 JAVA_HOME 和 CATALINA_HOME 设置正确。

我找到了解决方案,问题与Java虚拟机有关,如果Apache 版本是x64,我们需要安装x64 版本。 在 Apache Gui 配置上,tomcat8w(文件夹 apache-tomcat-8.0.23\bin)

这解决了将 tomcat 作为服务启动的问题。