简体   繁体   English

在Windows 7问题上启动服务Tomcat8:“创建java失败”

[英]Start service Tomcat8 on windows seven issue : “Failed creating java”

Start tomcat8 as a service on a windows seven computer for development purpose can be really... annoying. 在Windows 7计算机上启动tomcat8作为服务用于开发目的可能真的...很烦人。

I had this error : 我有这个错误:

    Failed creating java C:\Program Files (x86)\Java\jdk1.8.0_40\jre\bin\server\jvm.dll

And i saw in : 我看到了:

    C:\Program Files (x86)\Java\jdk1.8.0_40\bin

That the msvcr100.dll wasn't the same file i had in windows/system32 folder. msvcr100.dllwindows/system32文件夹中的文件不同。 In fact in my windows/System32 folder i had the msvcr100.dll that correspond to the x64 version. 实际上在我的windows/System32文件夹中,我有与x64版本对应的msvcr100.dll Tomcat service won't start and told me that it is not a valid 32 bit version. Tomcat服务无法启动并告诉我它不是有效的32位版本。

What i did to solve this was to install jdk1.8.0_40 in C:\\Program Files And looking in tomcat8w.exe the path in java tab named Java virtual Machine, i set this field to : 我解决这个问题的方法是在C:\\ Program Files中安装jdk1.8.0_40并在tomcat8w.exe中查找名为Java virtual Machine的java选项卡中的路径,我将此字段设置为:

C:\Program Files\Java\jdk1.8.0_40\jre\bin\server\mvcr100.dll

Now, for the service Tomcat8, it will be use the x64 dll, and all work correctly. 现在,对于服务Tomcat8,它将使用x64 dll,并且所有工作正常。

My Question is, could i replace the msvcr100.dll safely in windows\\system32 by the x86 version ? 我的问题是,我可以通过x86版本在windows \\ system32中安全地替换msvcr100.dll吗? Or my solution is good ? 或者我的解决方案很好?

Replacing lib it is not very good solution, because there are no any guarantees that it will work correctly with other programas. 替换lib它不是一个很好的解决方案,因为没有任何保证它可以与其他程序正常工作。 I propose just download new version of this lib in separate directory and try link it to Tomcat. 我建议只在单独的目录中下载此lib的新版本,并尝试将其链接到Tomcat。

Furthermore, looks like it is known issue: 此外,看起来它是已知的问题:

This is usually happen because of missing msvcr71.dll file. 这通常是因为缺少msvcr71.dll文件而发生的。 However tomcat doesn't use msvcr71.dll directly, it's used by the Java Virtual Machine (JVM). 但是tomcat不直接使用msvcr71.dll,它由Java虚拟机(JVM)使用。

Solution: 解:

1) Copy msvcr71.dll from java's bin directory to tomcat's bin folder. 1)将msvcr71.dll从java的bin目录复制到tomcat的bin文件夹。

2) Add java's bin directory to windows environment variable. 2)将java的bin目录添加到windows环境变量中。

3) Copy msvcr71.dll from java's bin directory to windows\\system32 folder. 3)将msvcr71.dll从java的bin目录复制到windows \\ system32文件夹。

4) Make sure your tomcat's pointing to correct jvm.dll folder. 4)确保你的tomcat指向正确的jvm.dll文件夹。

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM