hellonico / origami

Lowest barrier of entry to Image Processing, Computer Vision and Neural Networks on the JavaVM
https://hellonico.github.io/origami-docs/#/
Eclipse Public License 1.0
122 stars 7 forks source link

Ver 4.5.1-0 to 4.5.1-7 on windows 10, Couldn't load library library opencv_java451 exception while compiling #81

Closed imranypatel closed 2 years ago

imranypatel commented 3 years ago

Following Getting Started at https://cljdoc.org/d/origami/origami/4.1.2-7/doc/readme#getting-started

install the sample

lein new clj-opencv hello-origami

change directory

cd hello-origami

run the template simple example

lein run

D:\Work\iprnd\clojure\hello-origami>lein run Loading: opencv_java451 Exception in thread "main" java.lang.ExceptionInInitializerError, compiling:(opencv4/ok.clj:1:1) at clojure.lang.Compiler.load(Compiler.java:7526) at clojure.lang.RT.loadResourceScript(RT.java:379) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.load(RT.java:460) at clojure.lang.RT.load(RT.java:426) at clojure.core$load$fn__6548.invoke(core.clj:6046).... .....at clojure.lang.Var.applyTo(Var.java:702) at clojure.main.main(main.java:37) Caused by: java.lang.ExceptionInInitializerError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348).... ... at clojure.lang.Compiler.eval(Compiler.java:7062) at clojure.lang.Compiler.eval(Compiler.java:7051) at clojure.lang.Compiler.load(Compiler.java:7514) ... 40 more Caused by: java.lang.RuntimeException: java.io.IOException: Couldn't load library library opencv_java451 at origami.Origami.init(Origami.java:121) at opencv4.coreinit.load(Unknown Source) at opencv4.coreinit.(Unknown Source) ... 71 more Caused by: java.io.IOException: Couldn't load library library opencv_java451 at org.scijava.nativelib.NativeLoader.loadLibrary(NativeLoader.java:141) at origami.Origami.init(Origami.java:117) ... 73 more Caused by: java.lang.UnsatisfiedLinkError: no opencv_java451 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.scijava.nativelib.NativeLoader.loadLibrary(NativeLoader.java:136) ... 74 more

Experiencing same problem from 4.5.1-0 to 4.5.1-7.

Any advise please?

hellonico commented 3 years ago

which version of java would that be ?

hellonico commented 3 years ago

4.5.1-* versions all have the same compiled opencv libraries

imranypatel commented 3 years ago

> lein -v

Leiningen 2.9.7 on Java 1.8.0_181 Java HotSpot(TM) Client VM

imranypatel commented 3 years ago

> java -version

java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13) Java HotSpot(TM) Client VM (build 25.181-b13, mixed mode, sharing)

imranypatel commented 3 years ago

dependencies

:dependencies [[org.clojure/clojure "1.9.0"] [org.clojure/tools.cli "0.3.5"] [origami "4.5.1-0"] [origami/filters "1.30"] [origami/sources "1.0.1"]

; uncomment to use only the binary for your platform ;[origami "4.5.1-6" :exclusions [opencv/opencv-native]] ;[opencv/opencv-native "4.5.1-6" :classifier "osx_64"] ;[opencv/opencv-native "4.5.1-6" :classifier "linux_64"] [opencv/opencv-native "4.5.1-0" :classifier "windows_64"] ]) I've tried with both including/excluding native dependency.

hellonico commented 3 years ago

opencv_java451.dll.zip

This is a zip of the opencv DLL file we are trying to load ...

I just checked on a new windows 10 machine and it looks like some of the DLL imports are missing :/

image
imranypatel commented 3 years ago

Considering for me being novice on this Java/Clojure stack, could you please advise for specific steps I should take to move forward? E.g. Should I move or extract this zip file to some folder?

hellonico commented 3 years ago

So, OpenCV is a compiled library that I embed to make available via Java/Clojure... on Windows,Linux, OSX etc ...

Right now, the compiled Windows version does not load on your machine ... I need to check why and probably recompile a new windows version.

But, for private reasons I won't be able to do that for a 1-2 weeks. Sorry. :/ 
imranypatel commented 3 years ago

Appreciate as you at least replied. Meanwhile, I'll try it testing directly on Java using OpenCV Java related docs before trying it on Clojure.

hellonico commented 3 years ago

I am back ! after two weeks and a knee surgery ...

hellonico commented 3 years ago

So, I have reinstalled windows10 here, and things are working fine here.

origami is ok

This is on an 64 bit processor. set and processor

And java 17.

Could you open a command prompt and tell me the output of the command set

imranypatel commented 2 years ago

Hope you are doing well. Picked it up again. Just attempted afresh and it works! Thank you.