我正在使用Windows 10 我的java -version输出是
java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
运行此程序时出现以下错误
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files\Java\jdk1.8.0_25\include\win32\test.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.loadLibrary0(ClassLoader.java:1929)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1814)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1083)
at JNITest.<clinit>(JNITest.java:5)
我的节目是
public class JNITest {
static{
// System.load("/home/user1/
// JNI_project/mynativelib.so");
System.load("C:\\Program Files\\Java\\jdk1.8.0_25\\include\\win32\\test.dll");
}
// public native void LOSSGREENAMPT(TIMEINTERVAL, STARTINITIALLOSS,double ENDINITIALLOSS,double MOISTUREDEFICIT, double SUCTION,double CONDUCTIVITY, double STARTINFILTRATION,double FINALINFILTRATION, double IMPERVIOUSAREARATIO,int NUMBERPRECIP, double PRECIP(1),double EXCESS(1),int ERRORCODE[4], char ERRORMESSAGE[60],char L_errorMessage[60]);
public static void main(String[] args) {
JNITest test=new JNITest();
//test.greet();
}
}