不過剛好都不是我的root cause,在這裡留下我的解法
因為我一台電腦是JVM 32 bit,另一台是JVM 64 bit(可以java -d64 -version 指令來確認,如下圖)
,但我的dll是build成x86,導致我用JVM 64來跑時,就會出現這個錯誤。
解決的方法就是更改Visual studio的設定,重build一個x64的dll,就OK了。
真是一個不注意,就白花費了好多問題,呵!
JNI is a bridge between JAVA and C/C++,
many people encounter the error as Java.lang.UnsatisfiedLinkError,
my root cause is that my PC is JVM 32 bit, but my dll is built into 64 bit(you could check what java JVM version you use with command "java -d64 -version"),
the solution is very simple that to rebuild the dll to 32 bit.
沒有留言:
張貼留言