java.exe 不是有效的win32,Tomcat服务器不是作为服务启动:%1不是有效的Win32应用程序...

My tomcat server is working fine in Eclipse but when I try to start the server it is not starting.

Here are the errors:

[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.

What does these errors mean and how do I fix them?

解决方案

I had the exact same problem and it was caused by running a 32 bits Tomcat on a 64 bits windows. (I was using XAMPP 1.8.3 in a Windows 8 64 bits.)

First:

Make sure you have JAVA_HOME system variable pointing to your jdk folder (not the \bin);

Make sure %JAVA_HOME%\bin; is in your %PATH% system variable.

The solution:

Uninstall the Tomcat7 service if you have installed it already;

Download a 64 bit version of Tomcat 7 for windows (check this link to get the latest - I used the 7.0.42 version);

Replace the tomcat7.exe and tomcat7w.exe files of the C:\xampp\tomcat\bin folder with those present in the recently downloaded zip file.

Now you can install the service as usual (through XAMPP control panel, if you use it) and it should start just fine.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值