Library 'OpenIMAJGrabber' was not loaded successfully
See original GitHub issue@sarxos Hi ! When i use your webcam-capture, i meet a problem
java.lang.RuntimeException: Library 'OpenIMAJGrabber' was not loaded successfully from file 'C:\Users\USER\AppData\Local\Temp\BridJExtractedLibraries7239214121169806436\OpenIMAJGrabber.dll'
at org.bridj.BridJ.getNativeLibrary(BridJ.java:952)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:931)
at org.bridj.BridJ.getNativeLibrary(BridJ.java:543)
at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:652)
at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:858)
at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:785)
at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:249)
at org.bridj.BridJ.initialize(BridJ.java:1000)
at org.bridj.NativeObject.<init>(NativeObject.java:49)
at org.bridj.StructObject.<init>(StructObject.java:44)
at org.bridj.cpp.CPPObject.<init>(CPPObject.java:52)
at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.<init>(OpenIMAJGrabber.java:64)
at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:56)
at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:61)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
com.github.sarxos.webcam.WebcamException: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task
Just the same problem like @hepin1989 https://github.com/ochafik/nativelibs4java/issues/364
And my OS is win7 ultimate But, not all the win7 can not work ,just one of mine throw this exception, i don`t know why. Could you help please ??
Issue Analytics
- State:
- Created 10 years ago
- Comments:35 (17 by maintainers)
Top Results From Across the Web
Errors when Java 11 application is trying to access webcam
RuntimeException : Library 'OpenIMAJGrabber' was not loaded successfully from file ...
Read more >BoofCV on Raspberry with Pi Cam - Setting up - Google Groups
RuntimeException : Library 'OpenIMAJGrabber' was not loaded successfully". - it uses the dependencies boofcv-core; boofcv-swing ...
Read more >Local no dependencies problem remotelly ... - CodeRanch
RuntimeException : Library 'OpenIMAJGrabber' was not loaded successfully from ... -7.0.62/temp/BridJExtractedLibraries8127902075804486341/OpenIMAJGrabber.so'.
Read more >CameraHelper
RuntimeException : Library 'OpenIMAJGrabber' was not loaded successfully from file '/tmp/BridJExtractedLibraries5717506824090765864/OpenIMAJGrabber.so'.
Read more >library webcam-capture by sarxos not working on raspberry
Just to record the solution I provided in the ticket created in Webcam Capture API project on Github in case anyone has the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
More thoughts - BridJ can also fail the load because of some libraries missing (not sure about this, need to clarify), so there is a tool called Dependency Walker which allows you to check if all DLL dependencies are available on your PC.
To find the OpenIMAJGrabber.dll you have to open webcam-capture-0.3.10-RC1.jar with e.g. WinRAR and go to the com/github/sarxos/webcam/ds/buildin/lib/win32 and extract OpenIMAJGrabber.dll. Then, when you have itn on your desktop, fire Dependency Walker and go to File / Open, choose extracted DLL and hit Open button.
I also get this issue after trying to git checkout the repo into Eclipse. I test the dev environment by exporting the unedited webcam-capture jar and then use it in an existing project (to test the dev environment before I edit the library) and I get the following printing to console Note the github jar file you can download for webcam-capture-0.3.12.jar works with my existing project just fine but upon Eclipse 09-2022 -> File -> Import -> Git -> Projects from Git (with smart import) -> Clone URI -> URI: https://github.com/sarxos/webcam-capture.git Host: github.com Repository path: /sarxos/webcam-capture.git Protocol: Https -> Branch: Master -> Select All -> Finish -> No visible errors -> then Eclipse -> Export -> Java -> JAR file -> Next -> webcam-capture_webcam-capture -> Finish and upon importing the jar into my working other project (in place of the one available at the repo) I get this error:
java.io.FileNotFoundException: Library ‘OpenIMAJGrabber’ was not found in path ‘[., C:/Program Files/Java/jre1.8.0_161/bin/server, C:/Program Files/Java/jre1.8.0_161/bin, C:/Program Files/Java/jre1.8.0_161/lib/amd64, C:\ProgramData\Oracle\Java\javapath, C:\Windows\system32, C:\Windows, C:\Windows\System32\Wbem, C:\Windows\System32\WindowsPowerShell\v1.0, C:\Windows\System32\OpenSSH, C:\Program Files (x86)\Intel\Intel® Management Engine Components\DAL, C:\Program Files\Intel\Intel® Management Engine Components\DAL, C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common, C:\WINDOWS\system32, C:\WINDOWS, C:\WINDOWS\System32\Wbem, C:\WINDOWS\System32\WindowsPowerShell\v1.0, C:\WINDOWS\System32\OpenSSH, C:\Program Files\Intel\WiFi\bin, C:\Program Files\Common Files\Intel\WirelessCommon, C:\Program Files (x86)\Schneider Electric\SoMachine Software\Tools\ConfigurationManager, C:\Program Files (x86)\QuickTime\QTSystem, C:\Program Files\Java\jdk1.8.0_161, C:\Program Files\Java\jdk1.8.0_161\bin, C:\Program Files\WorldPainter, C:\Program Files\TortoiseSVN\bin, C:\Program Files\dotnet, C:\Users\PC\AppData\Local\Microsoft\WindowsApps, C:\Users\PC\Desktop\eclipse, C:\Program Files\Java\jre1.8.0_161\bin, C:\WINDOWS\system32, C:\WINDOWS, C:/Program Files/Java/jre1.8.0_161/bin/server, C:/Program Files/Java/jre1.8.0_161/bin, C:/Program Files/Java/jre1.8.0_161/lib/amd64, C:\ProgramData\Oracle\Java\javapath, C:\Windows\system32, C:\Windows, C:\Windows\System32\Wbem, C:\Windows\System32\WindowsPowerShell\v1.0, C:\Windows\System32\OpenSSH, C:\Program Files (x86)\Intel\Intel® Management Engine Components\DAL, C:\Program Files\Intel\Intel® Management Engine Components\DAL, C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common, C:\WINDOWS\system32, C:\WINDOWS, C:\WINDOWS\System32\Wbem, C:\WINDOWS\System32\WindowsPowerShell\v1.0, C:\WINDOWS\System32\OpenSSH, C:\Program Files\Intel\WiFi\bin, C:\Program Files\Common Files\Intel\WirelessCommon, C:\Program Files (x86)\Schneider Electric\SoMachine Software\Tools\ConfigurationManager, C:\Program Files (x86)\QuickTime\QTSystem, C:\Program Files\Java\jdk1.8.0_161, C:\Program Files\Java\jdk1.8.0_161\bin, C:\Program Files\WorldPainter, C:\Program Files\TortoiseSVN\bin, C:\Program Files\dotnet, C:\Users\PC\AppData\Local\Microsoft\WindowsApps, C:\Users\PC\Desktop\eclipse, ., C:\Program Files\Java\jre1.8.0_161\bin, C:\Program Files\Java\jre1.8.0_161\bin]’ at org.bridj.BridJ.getNativeLibrary(BridJ.java:1074) at org.bridj.BridJ.getNativeLibrary(BridJ.java:1049) at org.bridj.BridJ.getNativeLibrary(BridJ.java:602) at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:771) at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:1022) at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:904) at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:271) at org.bridj.BridJ.initialize(BridJ.java:1128) at org.bridj.NativeObject.(NativeObject.java:50) at org.bridj.StructObject.(StructObject.java:46) at org.bridj.cpp.CPPObject.(CPPObject.java:55) at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.(OpenIMAJGrabber.java:62) at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:55) at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:81) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Exception in thread “main” com.github.sarxos.webcam.WebcamException: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:124) at com.github.sarxos.webcam.Webcam.getWebcams(Webcam.java:893) at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:956) at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:933) at com.github.sarxos.webcam.Webcam.getDefault(Webcam.java:911) at guitest.Widgets.WebcamWidget.(WebcamWidget.java:60) at guitest.MainApp.main(MainApp.java:75) Caused by: java.util.concurrent.ExecutionException: com.github.sarxos.webcam.WebcamException: Cannot execute task at java.util.concurrent.FutureTask.report(Unknown Source) at java.util.concurrent.FutureTask.get(Unknown Source) at com.github.sarxos.webcam.WebcamDiscoveryService.getWebcams(WebcamDiscoveryService.java:116) … 6 more Caused by: com.github.sarxos.webcam.WebcamException: Cannot execute task at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.process(WebcamProcessor.java:72) at com.github.sarxos.webcam.WebcamProcessor.process(WebcamProcessor.java:140) at com.github.sarxos.webcam.WebcamTask.process(WebcamTask.java:46) at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.newGrabber(WebcamDefaultDriver.java:45) at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver.getDevices(WebcamDefaultDriver.java:117) at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:36) at com.github.sarxos.webcam.WebcamDiscoveryService$WebcamsDiscovery.call(WebcamDiscoveryService.java:1) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.RuntimeException: Failed to allocate new instance of type class com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:812) at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:1022) at org.bridj.cpp.CPPRuntime$CPPTypeInfo.initialize(CPPRuntime.java:904) at org.bridj.CRuntime$CTypeInfo.initialize(CRuntime.java:271) at org.bridj.BridJ.initialize(BridJ.java:1128) at org.bridj.NativeObject.(NativeObject.java:50) at org.bridj.StructObject.(StructObject.java:46) at org.bridj.cpp.CPPObject.(CPPObject.java:55) at com.github.sarxos.webcam.ds.buildin.natives.OpenIMAJGrabber.(OpenIMAJGrabber.java:62) at com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver$WebcamNewGrabberTask.handle(WebcamDefaultDriver.java:55) at com.github.sarxos.webcam.WebcamProcessor$AtomicProcessor.run(WebcamProcessor.java:81) … 3 more Caused by: java.io.FileNotFoundException: Library ‘OpenIMAJGrabber’ was not found in path ‘[., C:/Program Files/Java/jre1.8.0_161/bin/server, C:/Program Files/Java/jre1.8.0_161/bin, C:/Program Files/Java/jre1.8.0_161/lib/amd64, C:\ProgramData\Oracle\Java\javapath, C:\Windows\system32, C:\Windows, C:\Windows\System32\Wbem, C:\Windows\System32\WindowsPowerShell\v1.0, C:\Windows\System32\OpenSSH, C:\Program Files (x86)\Intel\Intel® Management Engine Components\DAL, C:\Program Files\Intel\Intel® Management Engine Components\DAL, C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common, C:\WINDOWS\system32, C:\WINDOWS, C:\WINDOWS\System32\Wbem, C:\WINDOWS\System32\WindowsPowerShell\v1.0, C:\WINDOWS\System32\OpenSSH, C:\Program Files\Intel\WiFi\bin, C:\Program Files\Common Files\Intel\WirelessCommon, C:\Program Files (x86)\Schneider Electric\SoMachine Software\Tools\ConfigurationManager, C:\Program Files (x86)\QuickTime\QTSystem, C:\Program Files\Java\jdk1.8.0_161, C:\Program Files\Java\jdk1.8.0_161\bin, C:\Program Files\WorldPainter, C:\Program Files\TortoiseSVN\bin, C:\Program Files\dotnet, C:\Users\PC\AppData\Local\Microsoft\WindowsApps, C:\Users\PC\Desktop\eclipse, C:\Program Files\Java\jre1.8.0_161\bin, C:\WINDOWS\system32, C:\WINDOWS, C:/Program Files/Java/jre1.8.0_161/bin/server, C:/Program Files/Java/jre1.8.0_161/bin, C:/Program Files/Java/jre1.8.0_161/lib/amd64, C:\ProgramData\Oracle\Java\javapath, C:\Windows\system32, C:\Windows, C:\Windows\System32\Wbem, C:\Windows\System32\WindowsPowerShell\v1.0, C:\Windows\System32\OpenSSH, C:\Program Files (x86)\Intel\Intel® Management Engine Components\DAL, C:\Program Files\Intel\Intel® Management Engine Components\DAL, C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common, C:\WINDOWS\system32, C:\WINDOWS, C:\WINDOWS\System32\Wbem, C:\WINDOWS\System32\WindowsPowerShell\v1.0, C:\WINDOWS\System32\OpenSSH, C:\Program Files\Intel\WiFi\bin, C:\Program Files\Common Files\Intel\WirelessCommon, C:\Program Files (x86)\Schneider Electric\SoMachine Software\Tools\ConfigurationManager, C:\Program Files (x86)\QuickTime\QTSystem, C:\Program Files\Java\jdk1.8.0_161, C:\Program Files\Java\jdk1.8.0_161\bin, C:\Program Files\WorldPainter, C:\Program Files\TortoiseSVN\bin, C:\Program Files\dotnet, C:\Users\PC\AppData\Local\Microsoft\WindowsApps, C:\Users\PC\Desktop\eclipse, ., C:\Program Files\Java\jre1.8.0_161\bin, C:\Program Files\Java\jre1.8.0_161\bin]’ at org.bridj.BridJ.getNativeLibrary(BridJ.java:1074) at org.bridj.BridJ.getNativeLibrary(BridJ.java:1049) at org.bridj.BridJ.getNativeLibrary(BridJ.java:602) at org.bridj.cpp.CPPRuntime.newCPPInstance(CPPRuntime.java:771) … 13 more
BridJ: LoadLibrary error when loading OpenIMAJGrabber : The specified module could not be found.