Tomcat 服务器未作为服务启动:%1 不是有效的 Win32 应用程序

2022-09-02 21:02:54

我的tomcat服务器在Eclipse中工作正常,但是当我尝试启动服务器时,它没有启动。

以下是错误:

[2012-08-15 09:26:09] [info] Procrun (2.0.5.0) started
[2012-08-15 09:26:09] [info] Running Service...
[2012-08-15 09:26:09] [info] Starting service...
[2012-08-15 09:26:09] [197  javajni.c] [error] %1 is not a valid Win32 application.
[2012-08-15 09:26:09] [994  prunsrv.c] [error] Failed creating java C:\java\java\jre\bin\server\jvm.dll
[2012-08-15 09:26:09] [1269 prunsrv.c] [error] ServiceStart returned 1
[2012-08-15 09:26:09] [info] Run service finished.
[2012-08-15 09:26:09] [info] Procrun finished.
[2012-08-15 09:29:06] [info] Procrun (2.0.5.0) started
[2012-08-15 09:29:06] [info] Running Service...
[2012-08-15 09:29:06] [info] Starting service...
[2012-08-15 09:29:06] [197  javajni.c] [error] %1 is not a valid Win32 application.
[2012-08-15 09:29:06] [994  prunsrv.c] [error] Failed creating java C:\java\java\jre\bin\server\jvm.dll
[2012-08-15 09:29:06] [1269 prunsrv.c] [error] ServiceStart returned 1
[2012-08-15 09:29:06] [info] Run service finished.
[2012-08-15 09:29:06] [info] Procrun finished.
[2012-08-15 09:30:07] [info] Procrun (2.0.5.0) started
[2012-08-15 09:30:07] [info] Running Service...
[2012-08-15 09:30:07] [info] Starting service...
[2012-08-15 09:30:07] [197  javajni.c] [error] %1 is not a valid Win32 application.
[2012-08-15 09:30:07] [994  prunsrv.c] [error] Failed creating java C:\java\java\jre\bin\server\jvm.dll
[2012-08-15 09:30:07] [1269 prunsrv.c] [error] ServiceStart returned 1
[2012-08-15 09:30:07] [info] Run service finished.
[2012-08-15 09:30:07] [info] Procrun finished.
[2012-08-15 09:30:57] [info] Procrun (2.0.5.0) started
[2012-08-15 09:30:57] [info] Running Service...
[2012-08-15 09:30:57] [info] Starting service...
[2012-08-15 09:30:57] [197  javajni.c] [error] %1 is not a valid Win32 application.
[2012-08-15 09:30:57] [994  prunsrv.c] [error] Failed creating java C:\java\java\jre\bin\server\jvm.dll
[2012-08-15 09:30:57] [1269 prunsrv.c] [error] ServiceStart returned 1
[2012-08-15 09:30:57] [info] Run service finished.
[2012-08-15 09:30:57] [info] Procrun finished.

这些错误是什么意思,我该如何解决?


答案 1

我遇到了完全相同的问题,这是由于在64位窗口上运行32位Tomcat引起的。(我在Windows 8 64位中使用XAMPP 1.8.3。

第一:

  • 确保系统变量指向 jdk 文件夹(而不是JAVA_HOME\bin);
  • 确保 在系统变量中。%JAVA_HOME%\bin;%PATH%

解决方案:

  • 卸载Tomcat7服务,如果你已经安装了它;
  • 下载64位版本的Tomcat 7 for windows(检查此链接以获取最新版本 - 我使用的是7.0.42版本);
  • 文件夹的 tomcat7.exetomcat7w.exe 文件替换为最近下载的 zip 文件中的文件。C:\xampp\tomcat\bin

现在,您可以像往常一样安装该服务(如果您使用它,则通过XAMPP控制面板),它应该可以正常启动。


答案 2

确保“jvm.dll”(启动tomcat8w时的标签“Java”.exe)的路径找到正确的Java运行时环境版本(x64或x86)。

在下面的两种情况下都会出现此问题:

1 - 您的 Tomcat 服务器版本是 64 位,但使用的是 32 位版本的 Java 虚拟机。
2 - 您的 Tomcat 服务器版本是 32 位,但使用的是 64 位版本的 Java 虚拟机。


推荐