windows环境直接执行startup.bat启动tomcat时,报如下错误:
报错信息
java.lang.UnsatisfiedLinkError: D:\server\tomcat-7-8443\bin\tcnative-1.dll: Can't load IA32-bit .dll on a AMD64-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1778)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
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(NativeMethodAccessorImpl.java:39)
原因
本地的JAHA_HOME指向32位的jdk(操作系统为64位windows,但个人原因,需要JAVA_HOME执行32的jdk环境),而tomcat为64位的。
解决方案
再装个64位的jdk,在catalina.bat指定刚装的64位的jdk位置,
catalina.bat配置
set JAVA_HOME=D:\Program Files\Java\jdk1.8.0_77
set JRE_HOME=D:\Program Files\Java\jre1.8.0_77