TristanTheHakSoar
asked on
com.googlecode.javacv not working
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.UnsatisfiedLinkE rror:
/private/var/folders/LB/LB 61BZtPFq4L ULxHfE3xPE +++TI/-Tmp -/libjniop encv_core6 6168757713 79943551.d ylib:
Library not loaded: lib/libopencv_core.2.4.dyl ib
Referenced from: /private/var/folders/LB/LB 61BZtPFq4L ULxHfE3xPE +++TI/-Tmp -/libjniop encv_core6 6168757713 79943551.d ylib
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.NoClassDefFoundE rror: 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 .getProper ty("java.c lasspath") )" and i still get the error which leads me to believe that the imports are causing the problem.
import com.googlecode.javacpp.Loa der;
import com.googlecode.javacv.*;
import static com.googlecode.javacv.cpp. opencv_cor e.*;
import static com.googlecode.javacv.cpp. opencv_img proc.*;
import static com.googlecode.javacv.cpp. opencv_cal ib3d.*;
import static com.googlecode.javacv.cpp. opencv_obj detect.*;
I compile and run with commands like:
javac -cp ../javacv.jar:../javacpp.j ar MotionDetector.java
java -cp ../javacv.jar:../javacpp.j ar 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
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.UnsatisfiedLinkE
/private/var/folders/LB/LB
Library not loaded: lib/libopencv_core.2.4.dyl
Referenced from: /private/var/folders/LB/LB
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.NoClassDefFoundE
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
import com.googlecode.javacpp.Loa
import com.googlecode.javacv.*;
import static com.googlecode.javacv.cpp.
import static com.googlecode.javacv.cpp.
import static com.googlecode.javacv.cpp.
import static com.googlecode.javacv.cpp.
I compile and run with commands like:
javac -cp ../javacv.jar:../javacpp.j
java -cp ../javacv.jar:../javacpp.j
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
In eclipse and on the command line the java.library.path returned is:
:/Library/Java/Extensions: /System/Li brary/Java /Extension s:/usr/lib /java
the first contains the files librxtxSerial.jnilib and RXTXcomm.jar
the second has a number of other jar and jnilib files
the last contains libjdns_sd.jnilib
neither of these are the path to the javacv jar files i included as external jars in the project if that helps.
:/Library/Java/Extensions:
the first contains the files librxtxSerial.jnilib and RXTXcomm.jar
the second has a number of other jar and jnilib files
the last contains libjdns_sd.jnilib
neither of these are the path to the javacv jar files i included as external jars in the project if that helps.
neither of these are the path to the javacv jar files i included as external jars in the project if that helps.
The important thing is that the native libraries must be in one of those directories. The classpath is another issue, and of course your jars must be in that
ASKER
he classpath is another issue, and of course your jars must be in that
I have noticed that on printing "java.classpath" it returns null, might this be the problem? I had assumed that my settings in the eclipse run/debug configuration merged the locations of those jar files with the classpath but perhaps I am mistaken, i will dig around a little more on those settings and try to get back with a success unless you come back with a better idea.
Also i decided that it would be a good idea to check the bitness of everything and all my librairies as well as eclipse are 64 so no problem there it seems.
I've also checked to make sure that I have the google app engine properly installed and it seems to be a part of my project, any way I can detect this or the jar files in my eclipse classpath? There are no errors that eclipse picks up and I am able to use all of the objects in the libraries, it is just the compilation that fails returning null pointers for whatever objects i try to create.
I have noticed that on printing "java.classpath" it returns null, might this be the problem?
No. That property doesn't exist. It's
System.out.println(System.getProperty("java.class.path"));
ASKER
ah kk, so i tried that and got the path this time with all the necessary jars included, i don't see a link to the opencv_core.2.4.dylib file though it probably shouldn't be in here?
I have gone into /opt/local/lib/ and found the following files:
libopencv_core.2.4.0.dylib
libopencv_core.2.4.dylib -> libopencv_core.2.4.0.dylib
libopencv_core.dylib -> libopencv_core.2.4.dylib
i did the opencv through macports so i assume these links should be working correctly, perhaps i should try to uninstall and reinstall the port?
I have gone into /opt/local/lib/ and found the following files:
libopencv_core.2.4.0.dylib
libopencv_core.2.4.dylib -> libopencv_core.2.4.0.dylib
libopencv_core.dylib -> libopencv_core.2.4.dylib
i did the opencv through macports so i assume these links should be working correctly, perhaps i should try to uninstall and reinstall the port?
ASKER
well that didnt work either, perhaps the way to go would be to implement in c++ and use a java wrapper for that.
anyone out there got javacv to run?
anyone out there got javacv to run?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
As mentioned above I have tried to set the environment variable DYLD_FALLBACK_LIBRARY_PATH with the value: ${env_var:/opt/local/lib/} but there are other variable types to choose from, perhaps I am using the wrong one?
That's not the point i made. I'm talking about java.library.path
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:)
ASKER
because it explains why it did not work in the first place, though the points go to who pointed to the right place
What do you get for java.library.path ?