tcnative-1.dll Can't load AMD 64-bit .dll on a IA 32-bit platform

匿名 (未验证) 提交于 2019-12-03 02:05:01

问题:

I'm getting this error when I try to run tomcat:

"java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\apache-tomcat-7.0.34\bin\tcnative-1.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform".

However, I have the 64 bit JRE downloaded, and double-checked my java version:

C:\Program Files (x86)\apache-tomcat-7.0.34\bin>java -version

java version "1.7.0_10"

Java(TM) SE Runtime Environment (build 1.7.0_10-b18)

Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

I've seen this question here before, but in one there was no resolution, and in the other it was an Eclipse issue, but I'm getting this error when I access tomcat directly.

How do I find out which "IA 32 bit platform" is being detected, and how do I point Tomcat in the right direction? Also, could this be why my servlet is getting this 404 error through Eclipse?

type Status report

message /JSPandServlet/Controller

description The requested resource is not available.

Logs:

C:\Program Files (x86)\apache-tomcat-7.0.34\bin>configtest.bat

Using CATALINA_BASE: "C:\Program Files (x86)\apache-tomcat-7.0.34"

Using CATALINA_HOME: "C:\Program Files (x86)\apache-tomcat-7.0.34"

Using CATALINA_TMPDIR: "C:\Program Files (x86)\apache-tomcat-7.0.34\temp"

Using JRE_HOME: "C:\Program Files (x86)\Java\jre7"

Using CLASSPATH: "C:\Program Files (x86)\apache-tomcat-7.0.34\bin\bootstra p.jar;C:\Program Files (x86)\apache-tomcat-7.0.34\bin\tomcat-juli.jar"

java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\apache-tomcat-7.0.34\bin\ tcnative-1.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform

    at java.lang.ClassLoader$NativeLibrary.load(Native Method)      at java.lang.ClassLoader.loadLibrary1(Unknown Source)      at java.lang.ClassLoader.loadLibrary0(Unknown Source)      at java.lang.ClassLoader.loadLibrary(Unknown Source)      at java.lang.Runtime.loadLibrary0(Unknown Source)      at java.lang.System.loadLibrary(Unknown Source)      at org.apache.tomcat.jni.Library.(Library.java:42)      at org.apache.tomcat.jni.Library.initialize(Library.java:174)      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)      at java.lang.reflect.Method.invoke(Unknown Source)      at org.apache.catalina.core.AprLifecycleListener.init(AprLifecycleListener.java:180)      at org.apache.catalina.core.AprLifecycleListener.isAprAvailable(AprLifecycleListener.java:85)      at org.apache.catalina.connector.Connector.setProtocol(Connector.java:595)      at org.apache.catalina.connector.Connector.(Connector.java:69)      at org.apache.catalina.startup.ConnectorCreateRule.begin(ConnectorCreateRule.java:62)      at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1276)      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)      at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)      at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)      at org.apache.catalina.startup.Catalina.load(Catalina.java:610)      at org.apache.catalina.startup.Catalina.load(Catalina.java:658)      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)      at java.lang.reflect.Method.invoke(Unknown Source)      at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455) 

Dec 26, 2012 7:15:47 PM org.apache.catalina.core.AprLifecycleListener init

INFO: The APR based Apache Tomcat Native library which allows optimal performanc e in production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jre7\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\PHP\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;c:\Program Files (x86)\Microsoft SQLServer\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;c:\Program Files (x86)\Microsoft SQL Server\10 0\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\SourceGear\Common\DiffMerge\;C:\Ruby193\bin;.

Dec 26, 2012 7:15:47 PM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["http-bio-8080"]

Dec 26, 2012 7:15:47 PM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["ajp-bio-8009"]

Dec 26, 2012 7:15:47 PM org.apache.catalina.startup.Catalina load

INFO: Initialization processed in 448 ms

回答1:

Oh man, I found the problem. I had an old JRE in a weird place which was being accessed by JRE_HOME. I removed that dir, fixed my environment variables, and that took care of it.



回答2:

I just found the solution. The problem was that my JRE_HOME pointed to a 32 bit JRE where in my machine was a 64 bit machine. I installed the 64 bit JRE and replaced it in the system variable and the server started clean



回答3:

Please check your default version pointed by eclipse.Properties->Java Compiler. Switch it to your JRE version installed. This worked for me. Thanks.



回答4:

Please check your Project SDK version used by IDE.

 In Intellij IDEA:  File -> Project Structure -> Project. In Eclipse:        Properties -> Java Compiler. 

Switch it to JDK x64 version installed.



回答5:

For the same message "Can't load IA 32-bit .dll on a AMD 64-bit platform" while trying to run a Jenkins slave on 64 bit windows machine, fixed it by removing JAVA_TOOL_OPTIONS and _JAVA_OPTIONS environment variables which were pointing to 32 bit jvmhook.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!