1.我的系统原来是XP(32位)的,后来换了新电脑win7(64位),用eclipse启动tomcat项目时报错信息为: Can't load AMD 64-bit .dll on a IA 32-bit platform
java.lang.UnsatisfiedLinkError: D:\Program Files\tomcat\apache-tomcat-7.0.59\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.loadLibrary0(ClassLoader.java:1807) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1732) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1028) at org.apache.tomcat.jni.Library.<init>(Library.java:42) at org.apache.tomcat.jni.Library.initialize(Library.java:173) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.core.AprLifecycleListener.init(AprLifecycleListener.java:207) at org.apache.catalina.core.AprLifecycleListener.isAprAvailable(AprLifecycleListener.java:108) at org.apache.catalina.connector.Connector.setProtocol(Connector.java:592) at org.apache.catalina.connector.Connector.<init>(Connector.java:66) at org.apache.catalina.startup.ConnectorCreateRule.begin(ConnectorCreateRule.java:62) at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1288) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501) at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561) at org.apache.catalina.startup.Catalina.load(Catalina.java:615) at org.apache.catalina.startup.Catalina.load(Catalina.java:663) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454) 2015-3-30 14:44:45 org.apache.tomcat.util.digester.SetPropertiesRule begin
截图:
二 解决方法:
1.查看jdk信息;是否为64位
如果不是,请到jdk官方网站:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
下载相对应的jdk版本,建议下载jdk-8u40-windows-x64.exe.
2.查看tomcat是否位64位
查看方法:D:\Program Files\tomcat\apache-tomcat-7.0.59\bin
在cmd里运行,可以查看信息如下:
看到这里,问题原因已经找到了---->AMD 64位的tomcat.
重新到tomcat官方网站:http://tomcat.apache.org/download-70.cgi
下载新的tomcat:32-bit/64-bit Windows Service Installer (pgp, md5, sha1)
重新安装,并配置好环境后,问题解决!
注:附上tomcat7安装图解:http://wenku.baidu.com/link?url=mhmfvYwbedkIqkwaN1KBkh1iXwk4ropdenNy8VlBacxYez5tFBCEww_8_95K3t0LfG5HNCb-gseZ4nF-19OLV-ZNOdEOP4C5JRPJyvmxbVm