Dec 17, 2016 - I had literally the exact same problem! With some digging, I found that the linker ld has different flags in Unix and OS X. Thus the error: ld: unknown option:.
You surely know that has now first class java support since version 2.4.4. What you may not know is that literally since yesterday it is quite easy to install it on MacOsX, given that you use. Box:lad$ sudo port selfupdate Password: - Updating MacPorts base sources using rsync MacPorts base version 2.1.3 installed, MacPorts base version 2.1.3 downloaded. Updating the ports tree - MacPorts base is already the latest version The ports tree has been updated. Many thanks to Andrew Stromnov to make this possible, since compiling yourself OpenCV with Java Support is not something the average Java guy will do. It was a pleasure.;-) ) Update: Keep in mind that the port command compiles the jar file with the currently available JDK.
If you run the port command in verbose mode you'll see that the jar file is assembled using ant. In order to force the port command to use a certain JDK you can patch the ant script: 80 # OS specific support. $var must be set to either true or false. 81 cygwin=false; 82 darwin=false; 83 mingw=false; 84 case '`uname`' in 85 CYGWIN.) cygwin=true;; 86 Darwin.) darwin=true 87 if -z '$JAVAHOME' ; then 88 if -x '/usr/libexec/javahome' ; then 89 JAVAHOME=`/usr/libexec/javahome -v 1.7` 90 elif -d '/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home' ; then 91 JAVAHOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home 92 fi 93 fi 94;; 95 MINGW.) mingw=true;; 96 esac Like this, the JDK 1.7 on my machine will be used for generating the jar file.
. Download a fresh copy of opencv-2.4.6.1 from. Extract it to some location in your Mac. now open terminal go inside the extracted folder opencv-2.4.6.1. Type following commands.
mkdir build. cd build. Make sure your JAVAHOME environment variable is set or explicitly type export JAVAHOME=. cmake -G 'Unix Makefiles' -D CMAKECXXCOMPILER=/usr/bin/g -D CMAKECCOMPILER=/usr/bin/gcc -D WITHCUDA=ON. make -j4 // here number 4 means the number of cores in your processor. make install. Hello Sumit, I'm facing problems when I try to run a.jar of my application, that I generated with Eclipse.
It throws the following error: Exception in thread 'main' java.lang.UnsatisfiedLinkError: no opencvjava246 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1878) at java.lang.Runtime.loadLibrary0(Runtime.java:849) at java.lang.System.loadLibrary(System.java:1087) at Main.main(Main.java:11) I need that the.jar runs in any computer. I would appreciate your help a lot!
Thank you very much! Hi, I follow the steps, but when I run my project, this says: Exception in thread 'main' java.lang.UnsatisfiedLinkError: no opencvjava249 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1764) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1044) at visionporcomputadora.main.main(main.java:46) the line 46 says: System.loadLibrary(Core.NATIVELIBRARYNAME); I have a macbook. Hope you can help me, sorry for my english.