错误Can't load IA 32-bit .dll on a AMD 64-bit platform解决方案

今天第一次使用idea,在配置完jdk和tomcat后启动项目,报如下错误

警告: The APR based Apache Tomcat Native library failed to load. The error reported was [D:\tomcat\apache-tomcat-7.0.75\bin\tcnative-1.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform]
java.lang.UnsatisfiedLinkError: D:\tomcat\apache-tomcat-7.0.75\bin\tcnative-1.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1880)
	at java.lang.Runtime.loadLibrary0(Runtime.java:849)
	at java.lang.System.loadLibrary(System.java:1088)
	at org.apache.tomcat.jni.Library.(Library.java:42)
	at org.apache.tomcat.jni.Library.initialize(Library.java:178)
	at org.apache.catalina.core.AprLifecycleListener.init(AprLifecycleListener.java:200)
	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.(Connector.java:66)
	at org.apache.catalina.startup.ConnectorCreateRule.begin(ConnectorCreateRule.java:62)
	at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1303)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
	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:2786)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)
	at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1576)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:616)
	at org.apache.catalina.startup.Catalina.load(Catalina.java:667)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427)
错误原因为jdk版本和tomcat版本不一致,保证本地安装的jdk版本、idea中配置的jdk版本和idea中配置的tomcat版本一致即可。

查看本地安装jdk版本命令:

cmd后输入  java -version

C:\Users\Administrator>java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
第三行64-Bit即为64位

你可能感兴趣的:(Java)