Re: java.lang.UnsatisfiedLinkError: no opencv_imgproc in java.library.path

832 views
Skip to first unread message

Yang Peng

unread,
May 17, 2013, 11:33:03 PM5/17/13
to jav...@googlegroups.com
Resolved by extracting all so files in the opencv.jar

在 2013年5月16日星期四UTC-4下午9时09分06秒,Yang Peng写道:
I have set up the lib path correctly for sbt and build path for eclipse, however, I kept getting this error from both sbt and eclipse: java.lang.UnsatisfiedLinkError: no opencv_imgproc in java.library.path.
This is very weird. I can successfully run the program without using classes from the com.googlecode.javacv.cpp.opencv_imgproc, for example using opencv_core. But when using classes from this opencv_imgproc, the error comes.
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/javacpp1051808295623/libjniopencv_nonfree.so: libopencv_calib3d.so.2.4: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1864)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
at java.lang.Runtime.load0(Runtime.java:792)
at java.lang.System.load(System.java:1059)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:566)
at com.googlecode.javacpp.Loader.load(Loader.java:489)
at com.googlecode.javacpp.Loader.load(Loader.java:431)
at com.googlecode.javacv.cpp.opencv_nonfree.<clinit>(opencv_nonfree.java:88)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at com.googlecode.javacpp.Loader.load(Loader.java:453)
at com.googlecode.javacpp.Loader.load(Loader.java:431)
at com.googlecode.javacv.cpp.opencv_nonfree$SIFT.<clinit>(opencv_nonfree.java:96)
at py.Hello$.main(Hello.scala:43)
at py.Hello.main(Hello.scala)
Caused by: java.lang.UnsatisfiedLinkError: no opencv_imgproc in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
at com.googlecode.javacpp.Loader.load(Loader.java:481)
... 9 more

Samuel Audet

unread,
May 19, 2013, 12:31:37 AM5/19/13
to jav...@googlegroups.com
On 05/17/2013 10:09 AM, Yang Peng wrote:
> I have set up the lib path correctly for sbt and build path for eclipse,
> however, I kept getting this error from both sbt and
> eclipse: java.lang.UnsatisfiedLinkError: no opencv_imgproc in
> java.library.path.
> This is very weird. I can successfully run the program without using
> classes from the com.googlecode.javacv.cpp.opencv_imgproc, for example
> using opencv_core. But when using classes from this opencv_imgproc, the
> error comes.
> Exception in thread "main" java.lang.UnsatisfiedLinkError:
> /tmp/javacpp1051808295623/libjniopencv_nonfree.so:
> libopencv_calib3d.so.2.4: cannot open shared object file: No such file
> or directory

That has probably been fixed in this revision:
http://code.google.com/p/javacv/source/detail?r=42b41d0a1b208ab9a8cf71b1830cad1f8172ce0f

You can get an updated javacv.jar by calling, for example:
$ mvn install -Djavacpp.skip=true
Does that fix the problem?

Samuel

Peng, Yang

unread,
May 19, 2013, 1:12:32 PM5/19/13
to jav...@googlegroups.com
I got the latest version so I don't need to update.


2013/5/19 Samuel Audet <samuel...@gmail.com>


--

--- You received this message because you are subscribed to a topic in the Google Groups "javacv" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/javacv/VPkgEKPOwEQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to javacv+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Peng, Yang
 
Ph.D. student in Computer Engineering(2012 - ):
CISE, University of Florida
Bachelor of Science(2008 - 2012):
Department of Computer Science and Technology, Nanjing University, China

Samuel Audet

unread,
May 19, 2013, 9:14:54 PM5/19/13
to jav...@googlegroups.com
No you do not : The error would show "2.5" and not "2.4" if you were
using the latest version.

On 05/20/2013 02:12 AM, Peng, Yang wrote:
> I got the latest version so I don't need to update.
> ...

Peng, Yang

unread,
May 19, 2013, 10:08:58 PM5/19/13
to jav...@googlegroups.com
If you see the so files in the opencv-0.5 jar, these are actually 2.4 so files, because they are opencv 2.4.5 libraries. This is why they call the javacv-0.5 and 2.4 so files.
Believe me, I first tried to deal with the version issues. If it is that simple, I will never post.


2013/5/19 Samuel Audet <samuel...@gmail.com>
--

--- You received this message because you are subscribed to a topic in the Google Groups "javacv" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/javacv/VPkgEKPOwEQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to javacv+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Samuel Audet

unread,
May 19, 2013, 10:41:28 PM5/19/13
to jav...@googlegroups.com
On 05/20/2013 11:08 AM, Peng, Yang wrote:
> If you see the so files in the opencv-0.5 jar, these are actually 2.4 so files, because they are opencv 2.4.5 libraries. This is why they call the javacv-0.5 and 2.4 so files.
> Believe me, I first tried to deal with the version issues. If it is that simple, I will never post.

Ah oops, got confused here, sorry about that.

Ok, so when you mean the latest version, do you mean the latest revision
from the repository, rebuilt from scratch and all?

Peng, Yang

unread,
May 20, 2013, 10:19:09 AM5/20/13
to jav...@googlegroups.com
I use precompiled latest versions from the repository.


2013/5/19 Samuel Audet <samuel...@gmail.com>
--

--- You received this message because you are subscribed to a topic in the Google Groups "javacv" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/javacv/VPkgEKPOwEQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to javacv+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Samuel Audet

unread,
May 26, 2013, 1:28:55 AM5/26/13
to jav...@googlegroups.com
On 05/20/2013 11:19 PM, Peng, Yang wrote:
> I use precompiled latest versions from the repository.

It's still not clear what you're doing... There are no "precompiled"
versions in the "source code repository", so you must be meaning
something else.

Anyway, could you provide a few lines of code that fail so I could try
to reproduce it here and fix it? Thanks!

Samuel

Peng, Yang

unread,
May 26, 2013, 12:13:13 PM5/26/13
to jav...@googlegroups.com
I have fixed the problem. See here, https://code.google.com/p/javacv/downloads/list. There is a javacv-0.5-cppjars.zip. That is the precompiled opencv libraries.


2013/5/26 Samuel Audet <samuel...@gmail.com>
--

--- You received this message because you are subscribed to a topic in the Google Groups "javacv" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/javacv/VPkgEKPOwEQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to javacv+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Samuel Audet

unread,
Jun 2, 2013, 8:19:44 AM6/2/13
to jav...@googlegroups.com
On 05/27/2013 01:13 AM, Peng, Yang wrote:
> I have fixed the problem. See here,
> https://code.google.com/p/javacv/downloads/list. There is a
> javacv-0.5-cppjars.zip. That is the precompiled opencv libraries.

I know you said you "fixed" the problem by extracting everything from
the JAR files, but it should work without extracting anything... If you
could provide a few lines of code so that I may reproduce the problem
here, I would be able to find a better fix, thanks!

Samuel

Apeksha Bodade

unread,
Jun 6, 2017, 3:29:44 AM6/6/17
to javacv
hi!
I got an error while executing covar command in hadoop hipi in ubuntu
Error : "Error: java.lang.UnsatisfiedLinkError: no opencv_imgproc in java.library.path"
I downloaded the jar files from the link given by you, But where should I extract those jar files?


On Sunday, May 26, 2013 at 9:43:13 PM UTC+5:30, Yang Peng wrote:
I have fixed the problem. See here, https://code.google.com/p/javacv/downloads/list. There is a javacv-0.5-cppjars.zip. That is the precompiled opencv libraries.


2013/5/26 Samuel Audet <samuel...@gmail.com>
On 05/20/2013 11:19 PM, Peng, Yang wrote:
I use precompiled latest versions from the repository.

It's still not clear what you're doing... There are no "precompiled" versions in the "source code repository", so you must be meaning something else.

Anyway, could you provide a few lines of code that fail so I could try to reproduce it here and fix it? Thanks!

Samuel


--

--- You received this message because you are subscribed to a topic in the Google Groups "javacv" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/javacv/VPkgEKPOwEQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to javacv+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


Samuel Audet

unread,
Jun 6, 2017, 8:04:00 AM6/6/17
to Apeksha Bodade, javacv
Just put all the JAR files in the class path and it should work, but
watch out for error message such as the following in your log file:
https://github.com/bytedeco/javacv/issues/704#issuecomment-304504698

Samuel
Reply all
Reply to author
Forward
0 new messages