java.lang.UnsatisfiedLinkError

950 views
Skip to first unread message

Joseph Mwema

unread,
Jul 16, 2015, 2:16:55 PM7/16/15
to open...@googlegroups.com

Hi,

I need help. I just don't seem to know where I am going wrong while getting this error below.

run:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\open_alpr_dlls\openalprjni.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1937)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1855)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at com.openalpr.jni.Alpr.<clinit>(Alpr.java:7)
at Main.main(Main.java:32)
Java Result: 1

This is how I have added openalprjni.dll and the other *.dlls to the lib folder in my project workspace as shown on this image 


Here is my workspace from where java.lang.UnsatisfiedLinkError happens at line 32 of Main.java though I know it stems from System.loadLibrary("openalprjni"); in Alpr.java

I have also added the path C:\open_alpr_dlls\ to the java.library.path after creating another folder named open_alpr_dlls in my drive C:\ on windows and added the same *.dlls I put in lib folder of my project's workspace to it including openalprjni.dll

I have not been able to do much as I am still stuck with the above error on getting the java alpr together to start testing it and trying out things.

Please someone show me where I am going wrong as I am stuck and not making any headways on this at the moment.

I will gladly appreciate any help on this.

Regards,

Joseph Mwema
OPEN ALPR dlls in lib.PNG

Matt

unread,
Jul 16, 2015, 9:35:13 PM7/16/15
to open...@googlegroups.com, muith...@gmail.com
That's a pretty common JNI error message.  The leading suggestion online is to make sure you're using the correct binaries:

Maybe try the 32-bit and the 64-bit version, and see which one works.

Joseph Mwema

unread,
Jul 17, 2015, 6:15:01 AM7/17/15
to open...@googlegroups.com, muith...@gmail.com
Hi Matt,

Thanks for the suggestions.

I am actually on a Windows 7 workstation that is a 32 bit machine. Will the 64 bit binaries suffice on my 32 bit environment? I had downloaded the 32bit openaplr. Another thing I have noted is that if I go to where I have placed my *.dlls in   C:\open_alpr_dlls\ then add openalpr.conf then these folders java, runtime_data and samples then I execute the java_test.bat it runs very well. That is possibly an indicator that the binaries are OK.

I am still trying to figure out where is it that I am going wrong but before end of the day I will try and see if I can get it on eclipse.

Regards,

Joseph Mwema

Matt

unread,
Jul 17, 2015, 7:43:52 AM7/17/15
to open...@googlegroups.com, muith...@gmail.com
Yes, that means your binaries are OK.  It's something with java and it not finding the DLLs in the path -- JNI can be a pain to troubleshoot.  You should be able to drop it into windows\system32\ to make it work.  I would google around to see if you can find a solution -- this isn't something specific to OpenALPR, so there may be good advice online.

Joseph Mwema

unread,
Jul 17, 2015, 9:38:00 AM7/17/15
to open...@googlegroups.com, muith...@gmail.com
Thank you Matt,

I first tried to get OpenALPR to run on Eclipse without success then I transfered openalprjni binary and its dependencies to System32 as you had suggested.

Atleast now I can study and tinker with OpenALPR in Java and get to understand how it works. I want to detect and recognize Kenyan Car number plates in the end.

This is my Eclipse working space


This is my Netbeans working space

Tanzeel Rehman

unread,
Jan 8, 2016, 4:04:58 AM1/8/16
to OpenALPR
Hey Mat ..
i have 32bit system (eclipse environment).. using dependency walker i have installed all required dlls and placed them in system32 folder along with openalprjni.dll and others as mentioned above. In project's native library location i have added the dll path c:system32..Now it gives error openalprjni.dll:initialization of dll is failed..
Kindly point out the issue that whether the .dll is deprecated or what?

Tanzeel Rehman

unread,
Jan 8, 2016, 4:05:00 AM1/8/16
to OpenALPR

Matt

unread,
Jan 9, 2016, 11:17:03 AM1/9/16
to OpenALPR
All the other DLLs from the OpenALPR package need to be available to the openalprjni.dll in order to run.  They can be on the system path or in the same folder as the openalprjni.dll.


On Thursday, July 16, 2015 at 2:16:55 PM UTC-4, Joseph Mwema wrote:
Reply all
Reply to author
Forward
0 new messages