Load dll when using System.loadLibrary ()
I am using JNI to use some of the native directives. My code:
When I run the code, I got an exception:
Caused by: java.lang.UnsatisfiedLinkError: no poc_NativeShellExecutor in java.library.path
and I am sure that I have put poc_NativeShellExecutor.dll in C: \ Windows \ System32. Here's some information about my system:
Java version: 1.7.0_03, vendor: Oracle Corporation Java home: E:\Program Files (x86)\Java\jdk1.7.0_03\jre Default locale: en_US, platform encoding: GBK OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
Could you help me?
source to share
This is not a solution, but additional data that I hope will help find them.
I have the same problem as OP.
Windows7 Ultimate x64 SP1
I am running my 32 bit
using jvm 1.6.0_29 32 bit.
I tried to place
in the following folders:
C:\ C:\Windows C:\Program Files (x86)
and it works: mine
But if I put my dll in
I am getting an exception:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no test_x86 in java.library.path
I change mine
every time before I try to load the DLL, so it always starts at the appropriate directory:
java.library.path = C:/;C:\Program Files (x86)\Java\jre6\bin; ... java.library.path = C:/Windows;C:\Program Files (x86)\Java\jre6\bin; ... java.library.path = C:/Program Files (x86);C:\Program Files (x86)\Java\jre6\bin; ... java.library.path = C:/Windows/System32;C:\Program Files (x86)\Java\jre6\bin; ...
I have also tried using the default
the default) from
. No luck: this also throws the above exception.
I always have a single copy
in the folders located in
i.e. only one of the folders contains this file at a time.
It seems like Windows 7 x64
has some tricky limitations.
Previously on my Windows XP 32-bit machine, I never looked for changes in the
. I just used a call
in this folder and it always worked.
source to share