Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path #1098

Closed
kevinTveizaga opened this issue Nov 30, 2018 · 8 comments
Closed
Labels

Comments

@kevinTveizaga
Copy link

kevinTveizaga commented Nov 30, 2018

Hi,

I just started working with images so i wanted to use this library but i am having this error:

--- exec-maven-plugin:1.2.1:exec (default-cli) @ SDPC ---
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1258)
	at org.bytedeco.javacpp.Loader.load(Loader.java:999)
	at org.bytedeco.javacpp.Loader.load(Loader.java:891)
	at org.bytedeco.javacpp.opencv_core.<clinit>(opencv_core.java:10)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at org.bytedeco.javacpp.Loader.load(Loader.java:950)
	at org.bytedeco.javacpp.Loader.load(Loader.java:891)
	at org.bytedeco.javacpp.helper.opencv_core$AbstractArray.<clinit>(opencv_core.java:109)
	at modelo.ProcesadorDeImagenes.analizar(ProcesadorDeImagenes.java:35)
	at controlador.AccionAnalizar.actionPerformed(AccionAnalizar.java:36)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
	at java.awt.Component.processMouseEvent(Component.java:6533)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6298)
	at java.awt.Container.processEvent(Container.java:2236)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2294)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
	at java.awt.Container.dispatchEventImpl(Container.java:2280)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.UnsatisfiedLinkError: C:\Users\Kevo\.javacpp\cache\opencv-3.4.3-1.4.3-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\jniopencv_core.dll: Can't find dependent libraries
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1086)
	at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1238)
	... 47 more

imagen

as you can see i added the dependency just as it says in the README file.
perhaps i missed some extra configuration i read all the similar issues but they seem to be out of date, even i have tried some of them but i am still having the issue

I am working with Netbeans 8.2
OS: Windows 7
Maven version: 3.6.0
imagen

Thanks in advance.

@saudet
Copy link
Member

saudet commented Dec 1, 2018

It says something is missing from your system, could you find out what it is?
https://github.com/bytedeco/javacpp-presets/wiki/Debugging-UnsatisfiedLinkError-on-Windows

@kevinTveizaga
Copy link
Author

kevinTveizaga commented Dec 2, 2018

thanks saudet for the reply,
I have tried to run that Dependencies tool but since my OS version is relatively old i could not open it, so i did install Dependency Walker, that one worked very well,
imagen
this is what i get when i run it. Im not sure but it looks like the missing dependency is my Ucrtbase.dll, acording to what i found about it is related to the OS files.
My windows version
imagen
I have sought for a "replace" but i did not found any UCRTBASE.dll for windows 7. So i am going to try again on a different Windows version.

@saudet saudet added the bug label Dec 2, 2018
saudet added a commit to bytedeco/javacpp-presets that referenced this issue Dec 2, 2018
@saudet
Copy link
Member

saudet commented Dec 3, 2018

Thanks for checking this out! I've fixed this in commit bytedeco/javacpp-presets@26de6ef, but please try with the snapshots to make sure nothing else is broken: http://bytedeco.org/builds/

@kevinTveizaga
Copy link
Author

hi @saudet,
thank you very much, i will try the snaps. The issue is not present in windows 10 by the way.

@saudet
Copy link
Member

saudet commented Jan 12, 2019

The fix is now included with version 1.4.4. Thanks for reporting and for testing!

@saudet saudet closed this as completed Jan 12, 2019
@ipapagi
Copy link

ipapagi commented Mar 30, 2022

Exactly the same behavior I have with the versions 1.5.6 and 1.5.7 again in windows 7 but not in windows 10 and in linux. If I use the 1.4.4 the link error is disappeared. Please could you check it?

@saudet
Copy link
Member

saudet commented Mar 30, 2022

It looks like newer versions of OpenCV and/or Visual Studio won't build binaries that work on Windows 7 anymore.
For that, try to build from source on your machine: https://github.com/bytedeco/javacpp-presets#build-instructions

@ipapagi
Copy link

ipapagi commented Mar 30, 2022

Thank you for your answer. I'll do it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants