troubleshooting Question

com.googlecode.javacv not working

Avatar of TristanTheHakSoar
TristanTheHakSoar asked on
JavaMac OS XPhotos / Graphics Software
13 Comments2 Solutions3551 ViewsLast Modified:
Hey all,

I have been trying desperately to get javacv working on my MacBook 10.6.8 64-bit without any luck.

I followed the following quickstart guide: http://code.google.com/p/javacv/

I want to use eclipse to do this, but unfortunately i get the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError:
/private/var/folders/LB/LB61BZtPFq4LULxHfE3xPE+++TI/-Tmp-/libjniopencv_core6616875771379943551.dylib:  
Library not loaded: lib/libopencv_core.2.4.dylib  
Referenced from: /private/var/folders/LB/LB61BZtPFq4LULxHfE3xPE+++TI/-Tmp-/libjniopencv_core6616875771379943551.dylib  
Reason: image not found

I have tried dumping libopencv_core.2.4.dylib into every lib folder on my system with no luck and have tried changing the following variable in configurations.
DYLD_FALLBACK_LIBRARY_PATH
which i have set to:
/usr/local/lib
and
opt/local/lib
and various other lib directories i have placed the .dylib file into.

I have moved onto compiling on the command line providing the classpath to the jar files via the -cp option and the class compiles, but when i try to run i get the error:

Exception in thread "main" java.lang.NoClassDefFoundError: MotionDetector

So i pulled all the code out of motion detector except for a single print statement that would tell me the classpath "System.out.println(System.getProperty("java.classpath"))" and i still get the error which leads me to believe that the imports are causing the problem.

import com.googlecode.javacpp.Loader;
import com.googlecode.javacv.*;
import static com.googlecode.javacv.cpp.opencv_core.*;
import static com.googlecode.javacv.cpp.opencv_imgproc.*;
import static com.googlecode.javacv.cpp.opencv_calib3d.*;
import static com.googlecode.javacv.cpp.opencv_objdetect.*;

I compile and run with commands like:
javac -cp ../javacv.jar:../javacpp.jar MotionDetector.java
java -cp ../javacv.jar:../javacpp.jar MotionDetector

I have searched the internet for days now trying to find the correct way to include the googlecode into my classpath or on my system but haven't found any, i did follow a tutorial that installed the google plugin into eclipse so i figure it should be there, any help would be hugely appreciated.

- Tristan
MotionDetector2.java
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros