Cannot get javacv to run

80 views
Skip to first unread message

Boche

unread,
Jul 10, 2011, 4:44:49 PM7/10/11
to javacv
Hi .am pretty new to jni though am conversant with java. Am trying to
run a javacv program
and I have installed opencv2.2. I get the following error on my
netbeans console

.Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users
\boche\AppData\Local\Temp\jniopencv_core742936603062725048.dll: Can't
find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)

Am guessing the problem is the following code is with the following
imports
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_imgproc.*;
import static com.googlecode.javacv.cpp.opencv_objdetect.*;


I have been researching and it seems the new javacv moved from using
jna.
The issue seems to be with the jni .Any help would be appreciated

Samuel Audet

unread,
Jul 10, 2011, 10:05:21 PM7/10/11
to jav...@googlegroups.com
On 2011-07-11 05:44, Boche wrote:
> Hi .am pretty new to jni though am conversant with java. Am trying to
> run a javacv program
> and I have installed opencv2.2. I get the following error on my
> netbeans console

If your README.txt file says "OpenCV 2.3.0", you need to install OpenCV
2.3.0, not 2.2.0

Samuel

Boche

unread,
Jul 11, 2011, 8:24:23 AM7/11/11
to javacv
Thanks for the reply. I was actually asking how to setup jni to use
in javacv .
I have been able to set up javacv in ubuntu 10.04 ok pointing to the
jni folder
in /usr directory from Netbeans run configuration .I have never
really developed
using Windows,maybe that is the source of my problems.

Again any help would be really appreciated

Samuel Audet

unread,
Jul 11, 2011, 8:27:48 AM7/11/11
to jav...@googlegroups.com

Bob Chege

unread,
Jul 11, 2011, 9:18:32 AM7/11/11
to jav...@googlegroups.com
I have installed the Microsoft Visual C++ 2010 Redistributable Package but no change .
I had earlier suspected that I was lacking a compiler so I installed Borland
>There is still no change and I run the error .

Heres the full stack trace.:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1028)
    at com.googlecode.javacpp.Loader.load(Loader.java:343)
    at com.googlecode.javacpp.Loader.load(Loader.java:271)
    at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:125)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:291)
    at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:93)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:291)
    at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:88)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:291)
    at com.googlecode.javacv.cpp.opencv_objdetect.<clinit>(opencv_objdetect.java:90)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at com.googlecode.javacpp.Loader.load(Loader.java:291)
    at FaceRecogPanel.initOpenCV(FaceRecogPanel.java:143)
    at FaceRecogPanel.<init>(FaceRecogPanel.java:130)
    at FaceRecognizer.<init>(FaceRecognizer.java:35)
    at FaceRecognizer.main(FaceRecognizer.java:95)


Looks to me like a jni Issue. I just need to know if that is the case .About the Systempaths I did
configure them and even linked the javacv and javacpp files to *.dll
 in opencv bin directory. Nothing has changed

Samuel Audet

unread,
Jul 11, 2011, 9:27:50 AM7/11/11
to jav...@googlegroups.com
On 2011-07-11 22:18, Bob Chege wrote:
> I have installed the Microsoft Visual C++ 2010 Redistributable Package
> but no change .
> I had earlier suspected that I was lacking a compiler so I installed
> Borland
> >There is still no change and I run the error .
>
> Heres the full stack trace.:
>
> Exception in thread "main" java.lang.UnsatisfiedLinkError: no
> jniopencv_core in java.library.path

That's a different error than the one you posted earlier. This one means
you haven't added all the JAR files in your classpath, as indicated in
the README.txt file

Samuel

Bob Chege

unread,
Jul 11, 2011, 9:38:12 AM7/11/11
to jav...@googlegroups.com
I had already  added javacv and javacpp jars to the path and the error
occurred then as it is now. But I noticed that in the javacpp jar file the class opencv_core
does exist but not the jni version i.e jniopencv_core.

The error is the same as I had earlier posted only I have included the whole
stack trace now

Acc

unread,
Jul 13, 2011, 2:19:30 PM7/13/11
to javacv
I have exactly the same problem in (attempt of) running my JavaCV. Any
help would be greatly appreciated. Similarly as Boche, I have also
installed Microsoft Visual C++ 2010 Redistributable and also made
those crucial jars as a system path, nonetheless those exemplary
programs (like MotonDetector.java) always attempt to access C:\Users
\...\AppData\Local\Temp folder which results in immediate crash.

Samuel Audet

unread,
Jul 13, 2011, 9:25:10 PM7/13/11
to jav...@googlegroups.com
On 2011-07-14 03:19, Acc wrote:
> I have exactly the same problem in (attempt of) running my JavaCV. Any
> help would be greatly appreciated. Similarly as Boche, I have also
> installed Microsoft Visual C++ 2010 Redistributable and also made
> those crucial jars as a system path, nonetheless those exemplary
> programs (like MotonDetector.java) always attempt to access C:\Users
> \...\AppData\Local\Temp folder which results in immediate crash.

I may be able to help if you explain more precisely what you tried to do
exactly...

Samuel

Acc

unread,
Jul 21, 2011, 11:35:42 AM7/21/11
to javacv
Ok, issue solved, in those times of mutli-purpose installers Microsoft
Visual C++ 2010 Redistributable Package automatically installed x64
version on my system while i required x86 one.

Therefore to everyone who faces any issues: Remember to triple-check
everything + stick to instructions step by step and everything will
work.
Reply all
Reply to author
Forward
0 new messages