Exception in thread "Thread-5" java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:654)
at org.bytedeco.javacpp.Loader.load(Loader.java:492)
at org.bytedeco.javacpp.Loader.load(Loader.java:409)
at org.bytedeco.javacpp.opencv_core.
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.bytedeco.javacpp.Loader.load(Loader.java:464)
at org.bytedeco.javacpp.Loader.load(Loader.java:409)
at org.bytedeco.javacpp.helper.opencv_core$AbstractArray.
at org.bytedeco.javacv.OpenCVFrameConverter.convertToMat(OpenCVFrameConverter.java:140)
Please follow the instructions in the README.md file: https://github.com/bytedeco/javacv
If you follow the instructions, you won't have that problem.
Thank for your answer.
I config VMOption -Djavacpp.platform.dependencies=true. Finally It doesn't work. Please help me again
I'm getting the same error when running a jar file using JavaCv on Raspberry Pi.
Can someone please give any suggestions here?
Hi @saudet ,
I'm also facing the same error. But I've seen similar issues raised. But couldn't make it work.
Here is my problem:
For the first execution I'm facing: java.lang.UnsatisfiedLinkError: no jniopencv_core
and from next consecutive executions I'm facing: java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.javacpp.opencv_core
From https://github.com/bytedeco/javacv/issues/406 and https://github.com/imintel/javacv-on-centos-6/blob/master/entry.md , I learned that we don't need to install OpenCV to use JavaCV
This is the (installation)procedure followed :
We downloaded https://github.com/bytedeco/javacpp-presets and
We used :
export CLASSPATH=$CLASSPATH: . . .
export jvmargs="-Djavacpp.platform.dependencies=true"
to add all .jar files to classpath and set VM args.
But I'm still facing the same error.
I'm now currently using centos-release-6-8.el6.centos.12.3.x86_64.
But I've done the same in Ubuntu 14.04 and OSX el capitan, I had to install OpenCV to make it work. Can you please tell me what should I do to make my application work, without install OpenCV. Or what I'm missing ?
Could you try again with the just released JavaCV 1.3?
Hello @saudet ,
Thanks very much it is working now. I want to know how javacv comes with precompiled opencv. Can you please direct me to some resource that I can refer. Thanks.
This should explain everything:
https://github.com/bytedeco/javacpp-presets/wiki/Create-New-Presets
@geekprogramming I have the same problem 锛宧ave you solved it ?
@HADES-S Please try to follow the instructions in the README.md file. If that doesn't work, let me know, thanks!
hi , i am a newer , i dont understand this word :
This downloads binaries for all platforms, but to get binaries for only one platform we can set the javacpp.platform system property (via the -D command line option) to something like android-arm, linux-x86_64, macosx-x86_64, windows-x86_64, etc. Please refer to the README.md file of the JavaCPP Presets for details.
can you tell me how to execute that , is that means i add the -Djavacpp.platform=linux-x86_64 ? i dont
understand, can you teach me ?
Yes, something like -Djavacpp.platform=linux-x86_64 works.
sorry , is it a maven option ? or VM option
It is a VM option used by Maven. Try to read about system properties here:
https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html
In any case, let me know if calling mvn -Djavacpp.platform=linux-x86_64 install doesn't work for some reason! Thanks
i am sorry,but it has the same error,and i see it still have the opencv jar for windows
Binaries for Linux won't work on Windows...
I means both the linux and windows for opencv after use the mvn -Djavacpp.platform=linux-x86_64
To get both, don't use -Djavacpp.platform=linux-x86_64. Or what is your question?
hello, I change the GLIBC XX, and it became this wrong ,can you help me ?
Caused by: java.lang.UnsatisfiedLinkError: /home/admin/.javacpp/cache/opencv-3.2.0-1.3-linux-x86_64.jar/org/bytedeco/javacpp/linux-x86_64/libjniopencv_core.so: /home/admin/.javacpp/cache/opencv-3.2.0-1.3-linux-x86_64.jar/org/bytedeco/javacpp/linux-x86_64/libopencv_core.so.3.2: undefined symbol: _ZZN2cv3ocl7Image2D4Impl14getImageFormatEiibE16channelTypesNorm
I was having the same problem "jniopencv_core in java.library.path". But after adding "-Djavacpp.platform.dependencies=true", I now have a new problem. The problem is as follows:
OpenCV(3.4.1) Error: Assertion failed ((flags & FIXED_TYPE) != 0) in cv::_InputArray::type, file C:\projects\javacpp-presets\opencv\cppbuild\windows-x86_64\opencv-3.4.1\modules\core\src\matrix_wrap.cpp, line 807
#
#
#
#
#
#
#
@zjevander It's a bug in the deprecated C API of OpenCV that is not going to get fixed: opencv/opencv#11076 Please switch to the C++ API.
I really want to know how to switch to C++ API and I don't have idea about APIs